thermograph/web
Emi Griffith 913563788b Add a worker scheduler for city warming and IndexNow pings (#242)
warm_cities.py and indexnow.py are one-shot scripts run manually at deploy
today - nothing keeps the curated city set topped up, or pings IndexNow,
between deploys.

Add notifications/scheduler.py: an in-process APScheduler instance driving
two recurring jobs (city warming, daily; IndexNow --if-changed, every 6h by
default), gated by the same leader election as the notifier - only the
process that already won leadership starts it, so the jobs run in exactly
one place under multi-host Swarm rather than once per replica. Neither job
runs immediately on start: warm_cities already runs at deploy time, so an
immediate duplicate on every worker boot/restart would be wasted work.

Extract indexnow.submit_if_changed() from the CLI's --if-changed branch so
the scheduler and the command line share the exact same skip-when-unchanged
logic instead of two copies drifting apart. The CLI's plain (non-flag) path
is unchanged.

APScheduler over a Postgres-native queue: exactly one process ever runs
this, no fan-out/backpressure/dead-letter need, no new infrastructure.
2026-07-21 01:26:39 +00:00
..
__init__.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
app.py Add a worker scheduler for city warming and IndexNow pings (#242) 2026-07-21 01:26:39 +00:00
content.py Extract the glossary and static-page SEO copy into a schema-validated content/ tree (#241) 2026-07-21 01:21:11 +00:00
content_loader.py Extract the glossary and static-page SEO copy into a schema-validated content/ tree (#241) 2026-07-21 01:21:11 +00:00
homepage.py Persist the homepage feed to Postgres instead of a per-replica file (#232) 2026-07-21 00:24:17 +00:00
schemas.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
views.py Score every metric equally in the overall total (#218) 2026-07-20 05:45:57 +00:00