Skip to content

Commit 00134fe

Browse files
committed
No need for sqlite_ystore_factory()
1 parent 5a1d57b commit 00134fe

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

jupyter_server_ydoc/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from traitlets import Float, Int, Type, Unicode, observe
1010
from ypy_websocket.ystore import BaseYStore, SQLiteYStore # type: ignore
1111

12-
from .handlers import YDocRoomIdHandler, YDocWebSocketHandler, sqlite_ystore_factory
12+
from .handlers import JupyterSQLiteYStore, YDocRoomIdHandler, YDocWebSocketHandler
1313

1414

1515
class YDocExtension(ExtensionApp):
@@ -41,7 +41,7 @@ class YDocExtension(ExtensionApp):
4141
)
4242

4343
ystore_class = Type(
44-
default_value=sqlite_ystore_factory(),
44+
default_value=JupyterSQLiteYStore,
4545
klass=BaseYStore,
4646
config=True,
4747
help="""The YStore class to use for storing Y updates. Defaults to JupyterSQLiteYStore,

jupyter_server_ydoc/handlers.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,9 @@ class JupyterTempFileYStore(TempFileYStore):
2929
prefix_dir = "jupyter_ystore_"
3030

3131

32-
def sqlite_ystore_factory(
33-
db_path: str = ".jupyter_ystore.db", document_ttl: Optional[int] = None
34-
) -> Type[SQLiteYStore]:
35-
_db_path = db_path
36-
_document_ttl = document_ttl
37-
38-
class JupyterSQLiteYStore(SQLiteYStore):
39-
db_path = _db_path
40-
document_ttl = _document_ttl
41-
42-
return JupyterSQLiteYStore
32+
class JupyterSQLiteYStore(SQLiteYStore):
33+
db_path = ".jupyter_ystore.db"
34+
document_ttl = None
4335

4436

4537
class DocumentRoom(YRoom):

0 commit comments

Comments
 (0)