Draconai Documentation

dd_id_7029bc89e2
Special

Freshness Watchdog

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.html mtime.

Staleness Rules

  • Docs are stale if the latest WP page modified_gmt is 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.json and reset when freshness recovers.

Implementation

  • Script: server/var_www/scripts_server/notify_stale_jobs.py.
  • SMTP target from server/var_www/config.xml network/mailpit_bindings/smtp (fallback from runtime/backend/mailer_dsn).
  • Alert recipient: admin/email from /var/www/config.xml.

Schedule

  • Cron: * * * * * /usr/bin/python3 /var/www/scripts_server/notify_stale_jobs.py