Thermograph monorepo: graded-climate API + SSR frontend + infra, domain-specific containerized deploys
Find a file
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
accounts Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
alembic Move the climate record from parquet to TimescaleDB hypertables (#227) 2026-07-20 20:15:55 +00:00
core Add a Postgres advisory-lock leader election for multi-host deploys (#229) 2026-07-21 00:07:52 +00:00
data Move the climate record from parquet to TimescaleDB hypertables (#227) 2026-07-20 20:15:55 +00:00
deploy Add entrypoint one-shot migrate mode and a Swarm secrets shim (#231) 2026-07-21 00:18:05 +00:00
notifications Add a worker scheduler for city warming and IndexNow pings (#242) 2026-07-21 01:26:39 +00:00
templates Fix the footer leaking "wrapper. #}" from a broken Jinja comment (#211) 2026-07-20 04:14:56 +00:00
tests Add a worker scheduler for city warming and IndexNow pings (#242) 2026-07-21 01:26:39 +00:00
web Add a worker scheduler for city warming and IndexNow pings (#242) 2026-07-21 01:26:39 +00:00
alembic.ini Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
app.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
cities.json SEO: values filter — trim cities in anti-LGBTQ countries, keep notable hubs (#102) 2026-07-16 02:20:41 +00:00
cities_flavor.json SEO: values filter — trim cities in anti-LGBTQ countries, keep notable hubs (#102) 2026-07-16 02:20:41 +00:00
gen_cities.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
gen_flavor.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
indexnow.py Add a worker scheduler for city warming and IndexNow pings (#242) 2026-07-21 01:26:39 +00:00
migrate.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00
migrate_accounts_to_pg.py Containerize the app and move the databases to PostgreSQL 18 (#220) 2026-07-20 06:28:23 +00:00
migrate_cache_to_pg.py Move the climate record from parquet to TimescaleDB hypertables (#227) 2026-07-20 20:15:55 +00:00
paths.py Extract the glossary and static-page SEO copy into a schema-validated content/ tree (#241) 2026-07-21 01:21:11 +00:00
requirements-dev.txt Add backend test suite; gate direct pushes; serialize LAN deploys (#41) 2026-07-11 19:37:49 +00:00
requirements.txt Add a worker scheduler for city warming and IndexNow pings (#242) 2026-07-21 01:26:39 +00:00
warm_cities.py Split the backend into domain packages (#217) 2026-07-20 05:31:03 +00:00