feat: MTGJSON data manager service with download, unpack, and upsert

- Created MTGJSONManager service for complete data lifecycle
- Handles download, unpack (gzip/zip), and PostgreSQL upsert
- ON CONFLICT DO UPDATE preserves existing data
- Startup triggers initial download on first container init
- Health check verifies MTG data exists in database
- Weekly refresh via MTG_REFRESH_INTERVAL_DAYS setting
- Updated docker-compose start_period to 600s for download time
This commit is contained in:
2026-07-20 03:17:23 +00:00
parent bb231a5f5d
commit 99c7d08bb1
4 changed files with 770 additions and 246 deletions
+2 -2
View File
@@ -116,9 +116,9 @@ services:
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
interval: 30s
timeout: 10s
timeout: 30s
retries: 3
start_period: 40s
start_period: 600s # 10 minutes for initial data download
# Weekly database refresh (runs on a schedule)
mtg-refresh: