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

Method _reader

openspace/skill_engine/store.py:226–238  ·  view source on GitHub ↗

Open a temporary read-only connection. WAL mode allows concurrent readers and one writer. Each read operation gets its own connection so reads never block the event loop and never contend with the write lock.

(self)

Source from the content-addressed store, hash-verified

224
225 @contextmanager
226 def _reader(self) -> Generator[sqlite3.Connection, None, None]:
227 """Open a temporary read-only connection.
228
229 WAL mode allows concurrent readers and one writer.
230 Each read operation gets its own connection so reads never
231 block the event loop and never contend with the write lock.
232 """
233 self._ensure_open()
234 conn = self._make_connection(read_only=True)
235 try:
236 yield conn
237 finally:
238 conn.close()
239
240 def _cleanup_wal_on_startup(self) -> None:
241 """Remove stale WAL/SHM left by unclean shutdown.

Callers 15

load_recordMethod · 0.95
load_allMethod · 0.95
load_record_by_pathMethod · 0.95
get_versionsMethod · 0.95
load_by_categoryMethod · 0.95
load_analysesMethod · 0.95
load_all_analysesMethod · 0.95
find_skills_by_toolMethod · 0.95
find_childrenMethod · 0.95
countMethod · 0.95

Calls 3

_ensure_openMethod · 0.95
_make_connectionMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected