INNER CODE UNIT · Python
_LOG_RETENTION_INTERVAL_SECONDS
av1155/houndarr · src/houndarr/app.py:37
_LOG_RETENTION_INTERVAL_SECONDS = 24 * 60 * 60
async def _periodic_log_retention(retention_days: int) -> None:
"""Periodically purge old search_log rows during app uptime.
The supervisor task fires once every 24 hours and respects
``log_retention_days`` from :class:`AppSettings`. When the value is
``0`` the lifespan never spawns this task (see :func:`_lifespan`).
"""
while True:
await asyncio.sleep(_LOG_RETENTION_INTERVAL_SECONDS)
try:
purged = await purge_old_logs(retention_days)
if purged > 0:
logger.info(
"Periodic retention purged %d search_log rows older than %d days",
purged,