Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/cocoindex_code/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,17 @@ def remove_project(self, project_root: str) -> bool:
gc.collect()
return was_loaded

def close_all(self) -> None:
"""Close all loaded projects and release resources."""
import gc

for project in self._projects.values():
project.close()
self._projects.clear()
self._index_locks.clear()
self._indexing.clear()
gc.collect()

def list_projects(self) -> list[DaemonProjectInfo]:
"""List all loaded projects with their indexing state."""
return [
Expand Down Expand Up @@ -519,3 +530,4 @@ def _accept_loop() -> None:
accept_thread.join(timeout=2)
if tasks:
await asyncio.gather(*tasks, return_exceptions=True)
registry.close_all()
Loading