fix: stop AIS proxy crash-loop when API key is not set

Exit early from _ais_stream_loop() if AIS_API_KEY is empty instead of
endlessly spawning the Node proxy which immediately prints FATAL and
exits. This was flooding docker logs with hundreds of lines per minute.
This commit is contained in:
anoracleofra-code
2026-03-26 10:53:30 -06:00
parent 04939ee6e8
commit 81c90a9faf
+4
View File
@@ -487,6 +487,10 @@ def _ais_stream_loop():
proxy_script = os.path.join(os.path.dirname(os.path.dirname(__file__)), "ais_proxy.js")
backoff = 1 # Exponential backoff starting at 1 second
if not API_KEY:
logger.info("AIS_API_KEY not set — ship tracking disabled. Set AIS_API_KEY to enable.")
return
while _ws_running:
try:
logger.info("Starting Node.js AIS Stream Proxy...")