Prefetch SatNOGS transmitter cache at startup to fix loading delay

This commit is contained in:
James Smith
2026-03-18 15:00:03 +00:00
parent ee9bd9bbb2
commit ed1461626b
2 changed files with 34 additions and 0 deletions
+8
View File
@@ -1188,6 +1188,14 @@ def _init_app() -> None:
except Exception as e:
logger.warning(f"Failed to initialize TLE auto-refresh: {e}")
# Pre-warm SatNOGS transmitter cache so first dashboard load is instant
try:
if not os.environ.get('TESTING'):
from utils.satnogs import prefetch_transmitters
prefetch_transmitters()
except Exception as e:
logger.warning(f"SatNOGS prefetch failed: {e}")
threading.Thread(target=_deferred_init, daemon=True).start()