Split up some code for sanity #3

This commit is contained in:
Ian Renton
2025-12-23 11:51:00 +00:00
parent fd246fc17b
commit 61784e8af6
12 changed files with 341 additions and 242 deletions

View File

@@ -1,6 +1,7 @@
# Main script
import importlib
import logging
import os
import signal
import sys
@@ -28,7 +29,7 @@ run = True
def shutdown(sig, frame):
global run
logging.info("Stopping program, this may take up to 60 seconds...")
logging.info("Stopping program...")
web_server.stop()
for p in spot_providers:
if p.enabled:
@@ -40,6 +41,7 @@ def shutdown(sig, frame):
lookup_helper.stop()
spots.close()
alerts.close()
os._exit(0)
# Utility method to get a spot provider based on the class specified in its config entry.