MCPTap v2.5.3
[2.5.3]
Added
-
SQLite log retention via background asyncio task — a new
LogRetentionTaskruns every hour inside the aiohttp event loop and
deletes log entries older thanMCP_TAP_LOG_RETENTION_DAYS(default 30).
The task is wired into the application lifecycle (on_startup/
on_cleanup) alongside the existingConfigReloader, and gracefully
survives transient purge errors (logs and continues).settings.py— new fieldlog_retention_days(env
MCP_TAP_LOG_RETENTION_DAYS, default30).log_store.py— new methodLogStore.purge_old(retention_days)
that executesDELETE FROM request_logs WHERE timestamp < ?and
returns the number of deleted rows.log_retention.py— new module withLogRetentionTaskclass.app.py—_start_log_retention/_stop_log_retentionlifecycle
hooks; skipped when log store is disabled.
Tests:
tests/test_log_store.pyaddsTestPurgeOld(4 tests — deletes
old entries only, returns 0 when nothing to delete / when disabled,
deletes all when retention is 0).tests/test_log_retention.py(5
tests — purge_once, disabled store, start/stop lifecycle, purge in loop,
error resilience).