Skip to content

Commit

Permalink
Backport jupyterlab#13392 on branch 3.6.x (Added collaborative_docume…
Browse files Browse the repository at this point in the history
…nt_save_delay trait)
  • Loading branch information
davidbrochart authored and fcollonval committed Nov 10, 2022
1 parent ba52666 commit 3d93785
Showing 1 changed file with 10 additions and 1 deletion.
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 nbclassic.shim import NBClassicConfigShimMixin
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 @@ -556,6 +556,14 @@ class LabApp(NBClassicConfigShimMixin, 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 @@ -744,6 +752,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

0 comments on commit 3d93785

Please sign in to comment.