Skip to content

Commit

Permalink
Merge pull request #2 from dtaniwaki/remove-autotimeout
Browse files Browse the repository at this point in the history
Remove unnecessary autotimeout config
  • Loading branch information
dtaniwaki authored Feb 25, 2018
2 parents a7a5d5c + 309e225 commit 59224df
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 0 additions & 17 deletions ucrspawner/ucrspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 59224df

Please sign in to comment.