INNER CODE UNIT · Python
pruned
georgekhananaev/google-reviews-scraper-pro · api_server.py:98
pruned = app.state.api_key_db.prune_audit_log(retention_days)
if pruned:
log.info("Pruned %d audit log rows older than %d days",
pruned, retention_days)
except Exception: # noqa: BLE001
log.debug("Audit prune on startup failed", exc_info=True)
# Start auto-cleanup task
asyncio.create_task(cleanup_jobs_periodically())
yield
# Shutdown
log.info("Shutting down Google Reviews Scraper API Server")
review_db = getattr(app.state, "review_db", None)
if review_db is not None:
try:
review_db.close()