dd_id_7029bc89e2
Special
Freshness Watchdog
Table of Contents
Overview
- Server-side watchdog that alerts when docs or tests freshness goes stale.
- Sends direct SMTP email to the admin address in
config.xml(admin/email).
Data Sources
Sources
- Docs freshness: WordPress REST API (
/wp-json/wp/v2/pages) to find the most recently modified page. - Tests freshness:
/var/www/freshness/all_tests_cronjob_fresh.htmlmtime.
Staleness Rules
- Docs are stale if the latest WP page
modified_gmtis older than 2 minutes. - Tests are stale if the cron output HTML mtime is older than 2 minutes.
- If both are stale, a single combined alert is sent.
- Alerts are throttled via
/var/www/freshness/alerts.jsonand reset when freshness recovers.
Implementation
- Script:
server/var_www/scripts_server/notify_stale_jobs.py. - SMTP target from
server/var_www/config.xmlnetwork/mailpit_bindings/smtp(fallback fromruntime/backend/mailer_dsn). - Alert recipient:
admin/emailfrom/var/www/config.xml.
Schedule
- Cron:
* * * * * /usr/bin/python3 /var/www/scripts_server/notify_stale_jobs.py