mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
C2: wrap the 19-statement purge loop in a single BEGIN IMMEDIATE / COMMIT so a mid-maintenance crash can't leave half the cache tables purged. SetMaxOpenConns(1) guarantees the BEGIN, DELETEs, and COMMIT all share one SQLite connection. C3: run PRAGMA integrity_check at most once per week, gated on the mtime of a sentinel file (.integrity_check_last) under dataPath. Any result other than 'ok' is logged via slog.Error. The sentinel is touched even on failure so a corrupted DB doesn't re-run the check every cycle and spam logs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>