Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make separate config var for pub timeout

Note: the commit message of the parent of this commit is incorrect. The
timeout variable did control all worksheets, hence this commit.
  • Loading branch information...
commit 92ac38416fc909293312fb4fe945c86bcf4db971 1 parent 5993b5c
Keshav Kini kini authored
Showing with 23 additions and 20 deletions.
  1. +5 −7 sagenb/notebook/notebook.py
  2. +18 −13 sagenb/notebook/server_conf.py
12 sagenb/notebook/notebook.py
View
@@ -1250,16 +1250,14 @@ def update_worksheet_processes(self):
def quit_idle_worksheet_processes(self):
timeout = self.conf()['idle_timeout']
- if timeout == 0:
- # Quit only the doc browser worksheets
- for W in self.__worksheets.values():
- if W.docbrowser() and W.compute_process_has_been_started():
- W.quit_if_idle(self.conf()['idle_timeout'])
- return
+ pub_timeout = self.conf()['pub_timeout']
for W in self.__worksheets.values():
if W.compute_process_has_been_started():
- W.quit_if_idle(timeout)
+ if W.docbrowser():
+ W.quit_if_idle(pub_timeout)
+ else:
+ W.quit_if_idle(timeout)
def quit_worksheet(self, W):
try:
31 sagenb/notebook/server_conf.py
View
@@ -13,16 +13,15 @@
defaults = {'word_wrap_cols':72,
'max_history_length':250,
-
- 'idle_timeout':600, # for a live documentation worksheet:
- # quit the compute process if it has
- # been idle for 10 minutes
+
+ 'idle_timeout': 120,
+ 'pub_timeout': 120,
+ 'doc_timeout': 120,
'idle_check_interval':360,
-
+
'save_interval':360, # seconds
'doc_pool_size':128,
- 'doc_timeout': 120,
'pub_interact':False,
@@ -77,7 +76,19 @@
},
'idle_timeout': {
- DESC : _('Idle timeout (seconds)'),
+ DESC : _('Idle timeout for normal worksheets (seconds)'),
+ GROUP : G_SERVER,
+ TYPE : T_INTEGER,
+ },
+
+ 'pub_timeout': {
+ DESC : _('Idle timeout for published worksheets (seconds)'),
+ GROUP : G_SERVER,
+ TYPE : T_INTEGER,
+ },
+
+ 'doc_timeout': {
+ DESC : _('Idle timeout for live documentation (seconds)'),
GROUP : G_SERVER,
TYPE : T_INTEGER,
},
@@ -100,12 +111,6 @@
TYPE : T_INTEGER,
},
- 'doc_timeout': {
- DESC : _('Doc worksheet idle timeout (seconds)'),
- GROUP : G_SERVER,
- TYPE : T_INTEGER,
- },
-
'pub_interact': {
DESC : _('Enable published interacts (EXPERIMENTAL; USE AT YOUR OWN RISK)'),
GROUP : G_SERVER,
Please sign in to comment.
Something went wrong with that request. Please try again.