Persist URL dedup cache to SQLite (bounded, ~KB); keep video blobs in memory

Switch storage backend from in-memory to SQLite (silences the library warning).
recent_urls (the edit-redelivery dedup map) now survives restarts: it's tiny and
TTL-bounded, stored via the library KV store, with wall-clock timestamps and
prune-on-load. last_video is deliberately NOT persisted — each value is a base64
video up to ~133 MB, so persisting it would bloat the DB; it stays in memory.
DB lives at bot-state.db (gitignored).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 19:26:12 -04:00
parent c7eb101ff0
commit fd0da1a59e
2 changed files with 57 additions and 3 deletions
Vendored
+4
View File
@@ -8,6 +8,10 @@ signal-cli-data.bak.*
# Local service file (contains your phone number) — use signal-bot.service.example
signal-bot.service
# Runtime state (SQLite dedup cache) — created next to bot.py at runtime
bot-state.db
bot-state.db-*
# Python
venv/
__pycache__/