Migrate shared_db (sellers/market_comps) from SQLite to Postgres #45
Labels
No labels
accessibility
backlog
browser-pool
bug
cloud
enhancement
feature
infra
paid-tier
performance
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/snipe#45
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Under load test (infra#12, 100 concurrent users),
GET /api/searchreturns 500s due tosqlite3.OperationalError: database is locked.Root cause:
shared_db(sellers, market_comps) is a SQLite file. At 100 concurrent search requests all writing seller data, the WAL write queue overflows the 30s busy timeout.Immediate fix:
e539427wraps the post-scrape block intry/except OperationalError, returning raw listings with empty trust scores (degraded mode) instead of crashing.Long-term fix
Migrate
shared_dbshared state (sellers, market_comps) to Postgres, reusing theCOMMUNITY_DB_URL/CommunityDBpattern already wired up for community signals. Keep per-user data (listings, trust_scores, saved_searches) in per-user SQLite.Separate: enrich 504s
POST /api/enrich504s come from eBay API connection timeouts backing up Playwright threads for 60s, hitting the nginx proxy timeout. Addconnect_timeoutto the Browse API client or cap thread wall time.