perf(core): cache AgentStore SQLite connection per project
The dashboard re-instantiates AgentStore on every /api/agents request, and each instance was opening a fresh Database — re-running schema migrations and PRAGMA integrity_check on the full file. On a multi-hundred-MB DB that was 3-7s per request and leaked file handles. Sharing a cached Database keyed by rootDir reduces it to a one-time process cost. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
5
.changeset/agentstore-db-cache.md
Normal file
5
.changeset/agentstore-db-cache.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Cache the AgentStore SQLite connection per project so the dashboard no longer reopens the database, re-runs migrations, and re-executes `PRAGMA integrity_check` on every `/api/agents` request. On large project databases this turned a sub-100ms call into multi-second latency that bled into every dashboard view fetching the agent list.
|
||||
Reference in New Issue
Block a user