Skip to content

Run airport/airline imports on startup and weekly (AVI-43) - #18

Merged
cfarrell987 merged 1 commit into
masterfrom
feature/avi-43-airport-and-airlines-not-populating-on-startup
Aug 25, 2026
Merged

cfarrell987 merged 1 commit into
masterfrom
feature/avi-43-airport-and-airlines-not-populating-on-startup

Conversation

@cfarrell987

@cfarrell987 cfarrell987 commented Aug 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Web now runs import_airports --yes and import_airlines --yes on every container startup (after migrate, before gunicorn). Both commands are already idempotent (skip existing, sync disabled/re-enabled), so this only ever adds new rows.
  • A new scheduler service (ofelia, docker-native cron) re-runs the same two commands weekly via docker exec against the web container, driven by ofelia.job-exec.* labels on web.
  • If an import fails on startup (e.g. no network), it's logged but doesn't block gunicorn from starting.

Went with ofelia over Celery+Beat+Redis since there's no task-queue infra in the repo yet and this is just two weekly jobs — ofelia adds zero new Python dependencies, it's config-only.

Test plan

  • docker compose up -d --build from clean volumes: confirmed web logs show migrate → import_airports (3953 new) → import_airlines (1019 new) → gunicorn boot, in order
  • scheduler container logs show both jobs registered: import-airports and import-airlines, schedule @weekly
  • Verified via psql that airports_airport (3953 rows) and airlines_airline (1019 rows) are populated
  • Manually ran the exact scheduled commands via docker exec against the running web container (simulating what ofelia does) — confirmed idempotent re-run: 0 new rows, no errors

Web now imports airports and airlines on every container start (both
commands are idempotent, so this only picks up new/changed rows), and
a new ofelia sidecar re-runs them on a weekly schedule via docker exec
against the web container.
@cfarrell987
cfarrell987 force-pushed the feature/avi-43-airport-and-airlines-not-populating-on-startup branch from 1176332 to b35984d Compare August 25, 2026 18:45
@cfarrell987
cfarrell987 merged commit 922dc69 into master Aug 25, 2026
7 checks passed
@cfarrell987
cfarrell987 deleted the feature/avi-43-airport-and-airlines-not-populating-on-startup branch August 25, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant