Browse files

Merge pull request #1 from ppurka/livedoc_timeout

add options for live documentation timeout to the notebook command
  • Loading branch information...
2 parents 7346a9a + 9a0b7a4 commit ffe48b4576928cbb141ffc303681922797f81442 @kini kini committed Apr 2, 2013
Showing with 12 additions and 3 deletions.
  1. +5 −0 sagenb/notebook/notebook_object.py
  2. +5 −1 sagenb/notebook/run_notebook.py
  3. +2 −2 sagenb/notebook/server_conf.py
View
5 sagenb/notebook/notebook_object.py
@@ -102,6 +102,11 @@ class NotebookObject:
timeout can be useful as this will free the memory used by
idle sessions.
+ - ``doc_timeout`` -- integer (default: 600) seconds until idle
+ live documentation worksheet sessions automatically timeout,
+ i.e., the corresponding Sage session terminates.
+ 0 means "never timeout".
+
- ``server_pool`` -- list of strings (default: None) list;
this option specifies that worksheet processes run as a
separate user (chosen from the list in the ``server_pool``
View
6 sagenb/notebook/run_notebook.py
@@ -452,7 +452,9 @@ def notebook_run(self,
server_pool = None,
ulimit = '',
- timeout = 0,
+ timeout = 0, # timeout for normal worksheets. This is the
+ # same as idle_timeout in server_conf.py
+ doc_timeout = None, # timeout for documentation worksheets
upload = None,
automatic_login = True,
@@ -535,6 +537,8 @@ def notebook_run(self,
print "The notebook files are stored in:", nb._dir
nb.conf()['idle_timeout'] = int(timeout)
+ if doc_timeout is not None:
+ nb.conf()['doc_timeout'] = int(doc_timeout)
if openid is not None:
nb.conf()['openid'] = openid
View
4 sagenb/notebook/server_conf.py
@@ -14,8 +14,8 @@
defaults = {'word_wrap_cols':72,
'max_history_length':250,
- 'idle_timeout': 120,
- 'doc_timeout': 120,
+ 'idle_timeout': 120, # timeout in seconds for worksheets
+ 'doc_timeout': 600, # timeout in seconds for live docs
'idle_check_interval':360,
'save_interval':360, # seconds

0 comments on commit ffe48b4

Please sign in to comment.