Use SSE frontend #3

This commit is contained in:
Ian Renton
2025-12-22 15:47:45 +00:00
parent fd2986f310
commit 70a7bd4814
9 changed files with 97 additions and 44 deletions

View File

@@ -1,14 +1,18 @@
# Main script
from time import sleep
import gevent
from gevent import monkey; monkey.patch_all()
import importlib
import logging
import signal
import sys
from diskcache import Cache
from gevent import monkey; monkey.patch_all()
from core.cleanup import CleanupTimer
from core.config import config, WEB_SERVER_PORT, SERVER_OWNER_CALLSIGN, MAX_SPOT_AGE
from core.config import config, WEB_SERVER_PORT, SERVER_OWNER_CALLSIGN
from core.constants import SOFTWARE_NAME, SOFTWARE_VERSION
from core.lookup_helper import lookup_helper
from core.status_reporter import StatusReporter
@@ -22,10 +26,13 @@ status_data = {}
spot_providers = []
alert_providers = []
cleanup_timer = None
run = True
# Shutdown function
def shutdown(sig, frame):
global run
logging.info("Stopping program, this may take a few seconds...")
for p in spot_providers:
if p.enabled:
@@ -37,6 +44,7 @@ def shutdown(sig, frame):
lookup_helper.stop()
spots.close()
alerts.close()
run = False
# Utility method to get a spot provider based on the class specified in its config entry.
@@ -105,3 +113,7 @@ if __name__ == '__main__':
status_reporter.start()
logging.info("Startup complete.")
while run:
gevent.sleep(1)
exit(0)