Skip to content

feat(api): warm war status and statistics when DB is empty - #38

Merged
surrealwolf merged 1 commit into
mainfrom
feat/initial-sync-startup
Mar 30, 2026
Merged

feat(api): warm war status and statistics when DB is empty#38
surrealwolf merged 1 commit into
mainfrom
feat/initial-sync-startup

Conversation

@surrealwolf

Copy link
Copy Markdown
Collaborator

When the database has no row yet, GET /api/war/status and GET /api/statistics fetch from the live scraper, persist, and return the result so the first client request can succeed before the background initial collection from DataCollector.start() finishes.

Tests updated to mock scraper fallbacks and cover live-fetch success paths.

Made with Cursor

DataCollector already runs collect_all_data in a background thread on
startup; these GET handlers now fetch from the live scraper and persist
when no row exists yet, so the first request can succeed before the
initial collection finishes.

Tests mock the scraper for 404 paths and cover live-fetch success.

Made-with: Cursor
@surrealwolf
surrealwolf merged commit 153ac5c into main Mar 30, 2026
9 checks passed
@surrealwolf
surrealwolf deleted the feat/initial-sync-startup branch March 30, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant