Skip to content

Commit b8d5036

Browse files
committed
Update store config
1 parent ed37ced commit b8d5036

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

jupyter_collaboration/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def initialize_handlers(self):
8585
setattr(self.ystore_class, k, v)
8686

8787
# Instantiate the store
88-
self._store = self.ystore_class(path="jupyter_updates.db", log=self.log)
88+
self._store = self.ystore_class(log=self.log)
8989

9090
self.ywebsocket_server = JupyterWebsocketServer(
9191
rooms_ready=False,

jupyter_collaboration/stores.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33

4+
from __future__ import annotations
5+
6+
from logging import Logger
47
from traitlets import Int, Unicode
58
from traitlets.config import LoggingConfigurable
9+
610
from ypy_websocket.stores import SQLiteYStore as _SQLiteYStore
7-
from ypy_websocket.stores import TempFileYStore as _TempFileYStore
11+
from ypy_websocket.stores import FileYStore
812

913

10-
class TempFileYStore(_TempFileYStore):
11-
prefix_dir = "jupyter_ystore_"
14+
class TempFileYStore(FileYStore):
15+
def __init__(self, log: Logger | None = None):
16+
super().__init__(path=".jupyter_store", log=log)
1217

1318

1419
class SQLiteYStoreMetaclass(type(LoggingConfigurable), type(_SQLiteYStore)): # type: ignore
@@ -17,7 +22,7 @@ class SQLiteYStoreMetaclass(type(LoggingConfigurable), type(_SQLiteYStore)): #
1722

1823
class SQLiteYStore(LoggingConfigurable, _SQLiteYStore, metaclass=SQLiteYStoreMetaclass):
1924
db_path = Unicode(
20-
"./jupyter_ystore.db",
25+
".jupyter_store.db",
2126
config=True,
2227
help="""The path to the YStore database. Defaults to '.jupyter_ystore.db' in the current
2328
directory.""",
@@ -30,3 +35,6 @@ class SQLiteYStore(LoggingConfigurable, _SQLiteYStore, metaclass=SQLiteYStoreMet
3035
help="""The document time-to-live in seconds. Defaults to None (document history is never
3136
cleared).""",
3237
)
38+
39+
def __init__(self, log: Logger | None = None):
40+
super().__init__(path=self.db_path, log=log)

0 commit comments

Comments
 (0)