chore(home): mirror from kalinamall (9883e6a) with papatramp URLs

This commit is contained in:
2026-07-14 20:43:52 +10:00
commit ed4e78f6c3
312 changed files with 42790 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
"""CLI: python -m app.jobs.host_silence_scan"""
from __future__ import annotations
import logging
import sys
from app.database import SessionLocal
from app.services.host_silence_scan import dispatch_host_silence_notifications, run_host_silence_scan
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
logger = logging.getLogger("sac.host_silence_scan")
def main() -> int:
db = SessionLocal()
try:
results = run_host_silence_scan(db)
notified = dispatch_host_silence_notifications(db, results)
db.commit()
created = sum(1 for r in results if r.created)
logger.info(
"host_silence scan done stale_hosts=%s created=%s notified=%s",
len(results),
created,
notified,
)
return 0
except Exception:
db.rollback()
logger.exception("host_silence scan failed")
return 1
finally:
db.close()
if __name__ == "__main__":
sys.exit(main())