Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion backend/src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
PROD = os.getenv("PROD", "False") == "True"

# 8001 emulates the data server
BACKEND_URL = "https://api.statbotics.io" if PROD else "http://localhost:8001"
# The ETL self-trigger (update_curr_year_background and the freshness-ping probe)
# HTTP-calls BACKEND_URL to reach the data router. When the data router runs as a
# separate service the default is right, but a single-container deploy (e.g. a
# staging mirror serving all routers from one service) must point BACKEND_URL at
# its OWN backend, or the self-trigger hits the wrong host and ingestion never
# runs. Read it from the environment, falling back to the original default.
BACKEND_URL = os.getenv("BACKEND_URL") or (
"https://api.statbotics.io" if PROD else "http://localhost:8001"
)

# DB

Expand Down