MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / __init__

Method __init__

openspace/skill_engine/store.py:183–199  ·  view source on GitHub ↗
(self, db_path: Optional[Path] = None)

Source from the content-addressed store, hash-verified

181 """
182
183 def __init__(self, db_path: Optional[Path] = None) -> None:
184 if db_path is None:
185 db_dir = PROJECT_ROOT / ".openspace"
186 db_dir.mkdir(parents=True, exist_ok=True)
187 db_path = db_dir / "openspace.db"
188
189 self._db_path = Path(db_path)
190 self._mu = threading.Lock()
191 self._closed = False
192
193 # Crash recovery: clean up stale WAL/SHM from unclean shutdown
194 self._cleanup_wal_on_startup()
195
196 # Persistent write connection
197 self._conn = self._make_connection(read_only=False)
198 self._init_db()
199 logger.debug(f"SkillStore ready at {self._db_path}")
200
201 def _make_connection(self, *, read_only: bool) -> sqlite3.Connection:
202 """Create a tuned SQLite connection.

Callers

nothing calls this directly

Calls 3

_make_connectionMethod · 0.95
_init_dbMethod · 0.95

Tested by

no test coverage detected