From 309e22569c6d3b3932c3cb65baf60410f0a03d10 Mon Sep 17 00:00:00 2001 From: Daisuke Taniwaki Date: Sun, 25 Feb 2018 13:42:08 +0900 Subject: [PATCH] Remove unnecessary autotimeout config --- README.md | 8 -------- jupyterhub_config.py | 1 - ucrspawner/ucrspawner.py | 17 ----------------- 3 files changed, 26 deletions(-) diff --git a/README.md b/README.md index 7664e97..ac03117 100644 --- a/README.md +++ b/README.md @@ -95,14 +95,6 @@ c.UCRSpawner.gpu = 0 c.UCRSpawner.max_gpu = 2 ``` -### Auto timeout - -You can automatically stop running notebook servers which doesn't make any communication with the hub. Set the timeout period. - -```python -c.UCRSpawner.autotimeout = 1800 # in seconds -``` - ### Mesos Slaves You can get available resources of meso slaves in your handlers, which inherit `BaseHandler` through this spawner. diff --git a/jupyterhub_config.py b/jupyterhub_config.py index 3f6ef43..9cbf55b 100644 --- a/jupyterhub_config.py +++ b/jupyterhub_config.py @@ -21,6 +21,5 @@ c.UCRSpawner.max_disk = 5000 c.UCRSpawner.gpu = 0 c.UCRSpawner.max_gpu = 0 -c.UCRSpawner.autotimeout = 1800 c.UCRSpawner.mesos_user = os.environ['MESOS_USER'] c.UCRSpawner.debug = True diff --git a/ucrspawner/ucrspawner.py b/ucrspawner/ucrspawner.py index cc9a666..19937b2 100644 --- a/ucrspawner/ucrspawner.py +++ b/ucrspawner/ucrspawner.py @@ -103,11 +103,6 @@ class UCRSpawner(Spawner): mesos_user = Unicode(None, config=True, allow_none=True) - autotimeout = Integer(None, - help="Seconds to automatically timeout unused notebook servers", - config=True, - allow_none=True) - hub_ip_connect = Unicode( "", help="Public IP address of the hub" @@ -454,18 +449,6 @@ def poll(self): "No healthy instance for application %s", self.app_id) return 2 - if self.autotimeout is not None: - tm_diff = datetime.utcnow() - self.user.last_activity - self.log.debug("Application %s is inactive for %d sec", - self.app_id, tm_diff.seconds) - if tm_diff > timedelta(seconds=self.autotimeout): - self.log.info( - "Stopping application %s because it's inactive for more than %d sec", - self.app_id, self.autotimeout) - # Do not yield the result of stop here - self.stop() - return 0 - return None def get_mesos_slaves(self):