086-cron-purge-site-status.sql
1 -- Migration 086: Add purgeSiteStatusHistory cron job 2 -- Keeps last 5 status rows per site to prevent site_status growing unboundedly. 3 -- Observed: 2.3M rows ≈ 400MB before this job was added. 4 5 INSERT OR REPLACE INTO cron_jobs ( 6 name, 7 task_key, 8 description, 9 handler_type, 10 handler_value, 11 interval_value, 12 interval_unit, 13 enabled, 14 critical 15 ) VALUES ( 16 '9.2 Purge Site Status History', 17 'purgeSiteStatusHistory', 18 'Keep last 5 site_status rows per site; 1 row for ignored sites. Prevents unbounded DB growth.', 19 'function', 20 'purgeSiteStatusHistory', 21 24, 22 'hours', 23 1, 24 0 25 );