MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / db_startup_lock

Function db_startup_lock

core/database.py:69–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67
68@asynccontextmanager
69async def db_startup_lock():
70 os.makedirs(data_root, exist_ok=True)
71 lock_file = open(_STARTUP_LOCK_FILE, "a+", encoding="utf-8")
72 try:
73 await asyncio.to_thread(_lock_file, lock_file)
74 yield
75 finally:
76 await asyncio.to_thread(_unlock_file, lock_file)
77 lock_file.close()
78
79
80async def init_db():

Callers 3

lifespanFunction · 0.90
initialize_systemFunction · 0.90
init_dbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected