[fix] Make BACKEND_URL env-configurable so single-container deploys self-trigger their own ETL - #16
Closed
chondl wants to merge 1 commit into
Closed
[fix] Make BACKEND_URL env-configurable so single-container deploys self-trigger their own ETL#16chondl wants to merge 1 commit into
chondl wants to merge 1 commit into
Conversation
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).
Owner
Author
|
Consolidated: this BACKEND_URL env-config change was folded into #23 [05] ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The ETL self-trigger —
update_curr_year_background(cron path) and the freshness-ping probe (_ping_probe) — doesrequests.get(f"{BACKEND_URL}/v3/...")to reach the data router.BACKEND_URLwas hardcoded to upstreamhttps://api.statbotics.iounderPROD.On a single-container deploy that serves
/v3,/v3/site, and/v3/datafrom 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_URLfrom 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_URLset 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 againstmasterfor review + promotion.