From 8e50491978ba2c37c66ce95c9405a4d61d317c84 Mon Sep 17 00:00:00 2001 From: asteppke Date: Tue, 18 Jun 2024 17:28:29 +0200 Subject: [PATCH] Workaround for later initialization, recovers document_ttl --- projects/jupyter-server-ydoc/jupyter_server_ydoc/stores.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/jupyter-server-ydoc/jupyter_server_ydoc/stores.py b/projects/jupyter-server-ydoc/jupyter_server_ydoc/stores.py index 4f31a9de..f773c248 100644 --- a/projects/jupyter-server-ydoc/jupyter_server_ydoc/stores.py +++ b/projects/jupyter-server-ydoc/jupyter_server_ydoc/stores.py @@ -30,3 +30,9 @@ class SQLiteYStore(LoggingConfigurable, _SQLiteYStore, metaclass=SQLiteYStoreMet help="""The document time-to-live in seconds. Defaults to None (document history is never cleared).""", ) + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + # Class is instantiated later, so we need to set the document_ttl here + self.document_ttl = int(self.document_ttl) if self.document_ttl is not None else None + \ No newline at end of file