Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added collaborative_document_save_delay trait #13392

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion jupyterlab/labapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
WorkspaceListApp,
)
from notebook_shim.shim import NotebookConfigShimMixin
from traitlets import Bool, Instance, Int, Type, Unicode, default
from traitlets import Bool, Float, Instance, Int, Type, Unicode, default
from ypy_websocket.ystore import BaseYStore

from ._version import __version__
Expand Down Expand Up @@ -580,6 +580,14 @@ class LabApp(NotebookConfigShimMixin, LabServerApp):
document will be kept in memory forever.""",
)

collaborative_document_save_delay = Float(
1,
allow_none=True,
config=True,
help="""The delay in seconds to wait after a change is made to a document before saving it
(relevant only in collaborative mode). Defaults to 1s, if None then the document will never be saved.""",
)

collaborative_ystore_class = Type(
default_value=JupyterSQLiteYStore,
klass=BaseYStore,
Expand Down Expand Up @@ -816,6 +824,7 @@ def initialize_handlers(self):
"page_config_data": page_config,
"collaborative_file_poll_interval": self.collaborative_file_poll_interval,
"collaborative_document_cleanup_delay": self.collaborative_document_cleanup_delay,
"collaborative_document_save_delay": self.collaborative_document_save_delay,
"collaborative_ystore_class": self.collaborative_ystore_class,
}
)
Expand Down