Skip to content

[fix] Make BACKEND_URL env-configurable so single-container deploys self-trigger their own ETL - #16

Closed
chondl wants to merge 1 commit into
masterfrom
fix-backend-url-selftrigger
Closed

[fix] Make BACKEND_URL env-configurable so single-container deploys self-trigger their own ETL#16
chondl wants to merge 1 commit into
masterfrom
fix-backend-url-selftrigger

Conversation

@chondl

@chondl chondl commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Problem

The ETL self-trigger — update_curr_year_background (cron path) and the freshness-ping probe (_ping_probe) — does requests.get(f"{BACKEND_URL}/v3/...") to reach the data router. BACKEND_URL was hardcoded to upstream https://api.statbotics.io under PROD.

On a single-container deploy that serves /v3, /v3/site, and /v3/data from one service (the staging mirror), that means the self-trigger fired at the upstream production host instead of the mirror's own backend — so despite pings firing on every page view, ingestion never ran and live match updates never landed.

Fix

Read BACKEND_URL from the environment, falling back to the original default. The deploy sets it to the service's own URL. No change for the multi-service layout (env var unset → original default).

Verification

On the staging mirror, with BACKEND_URL set to the mirror's own API: a page-view ping now drives a full ingest cycle on the mirror, and 2026 IRI caught up to TBA in real time (21 played matches, 0 score mismatches vs TBA).

Note

Already live on staging (deployed); this captures the same fix against master for review + promotion.

The ETL self-trigger (update_curr_year_background, the freshness-ping probe)
HTTP-calls BACKEND_URL to reach the data router. Hardcoded to upstream
api.statbotics.io under PROD, a single-container deploy that serves all routers
from one service (e.g. a staging mirror) sent its self-trigger to the wrong host
and never ran ingestion. Read BACKEND_URL from env with the original default as
fallback; the deploy sets it to the service's own URL.

Verified on the staging mirror: with BACKEND_URL set to the mirror's own API,
page-view pings now drive live ingestion (2026iri caught up to TBA in real time).
@chondl
chondl deleted the branch master July 19, 2026 19:01
@chondl chondl closed this Jul 19, 2026
@chondl
chondl deleted the fix-backend-url-selftrigger branch July 19, 2026 19:01
@chondl

chondl commented Jul 19, 2026

Copy link
Copy Markdown
Owner Author

Consolidated: this BACKEND_URL env-config change was folded into #23 [05] (cph-db-retirement). Branch deleted; commit preserved in that PR.

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