[sagenb] 74/179: Make separate config var for pub timeout
felix salfelder
felix-guest at moszumanska.debian.org
Tue May 6 12:05:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch master
in repository sagenb.
commit 92ac38416fc909293312fb4fe945c86bcf4db971
Author: Keshav Kini <keshav.kini at gmail.com>
Date: Mon Apr 1 17:21:40 2013 -0700
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.
---
sagenb/notebook/notebook.py | 12 +++++-------
sagenb/notebook/server_conf.py | 31 ++++++++++++++++++-------------
2 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/sagenb/notebook/notebook.py b/sagenb/notebook/notebook.py
index f62ddd2..7faecff 100644
--- a/sagenb/notebook/notebook.py
+++ b/sagenb/notebook/notebook.py
@@ -1250,16 +1250,14 @@ class Notebook(object):
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:
diff --git a/sagenb/notebook/server_conf.py b/sagenb/notebook/server_conf.py
index f619d7e..cfd8279 100644
--- a/sagenb/notebook/server_conf.py
+++ b/sagenb/notebook/server_conf.py
@@ -13,16 +13,15 @@ _ = lazy_gettext
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 @@ defaults_descriptions = {
},
'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 @@ defaults_descriptions = {
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,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git
More information about the debian-science-commits
mailing list