mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-18 11:55:46 +08:00
add settings[‘activity_sources’]
for extensions to register activity that should prevent shutdown due to inactivity
This commit is contained in:
parent
ae1f167dc6
commit
f0a96b5ffb
@ -264,6 +264,8 @@ class NotebookWebApplication(web.Application):
|
||||
|
||||
# Jupyter stuff
|
||||
started=now,
|
||||
# place for extensions to register activity
|
||||
activity_sources={},
|
||||
jinja_template_vars=jupyter_app.jinja_template_vars,
|
||||
nbextensions_path=jupyter_app.nbextensions_path,
|
||||
websocket_url=jupyter_app.websocket_url,
|
||||
@ -360,6 +362,7 @@ class NotebookWebApplication(web.Application):
|
||||
sources.append(self.settings['terminal_last_activity'])
|
||||
except KeyError:
|
||||
pass
|
||||
sources.extend(self.settings['activity_sources'].values())
|
||||
return max(sources)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user