Implement a max spot age filter. Closes #18

This commit is contained in:
Ian Renton
2025-10-02 09:57:25 +01:00
parent 9640c0e0c1
commit 1a9dc0b634
8 changed files with 49 additions and 17 deletions

10
main.py
View File

@@ -10,7 +10,8 @@ import psutil
import pytz
from core.cleanup import CleanupTimer
from core.config import config
from core.config import config, MAX_SPOT_AGE, WEB_SERVER_PORT, SERVER_OWNER_CALLSIGN
from core.constants import SOFTWARE_VERSION
from providers.aprsis import APRSIS
from providers.dxcluster import DXCluster
from providers.gma import GMA
@@ -76,8 +77,11 @@ if __name__ == '__main__':
formatter = logging.Formatter("%(message)s")
handler.setFormatter(formatter)
root.addHandler(handler)
logging.info("Starting...")
startup_time = datetime.now(pytz.UTC)
status_data["software-version"] = SOFTWARE_VERSION
status_data["server-owner-callsign"] = SERVER_OWNER_CALLSIGN
# Shut down gracefully on SIGINT
signal.signal(signal.SIGINT, shutdown)
@@ -92,11 +96,11 @@ if __name__ == '__main__':
p.start()
# Set up timer to clear spot list of old data
cleanup_timer = CleanupTimer(spot_list=spot_list, cleanup_interval=60, max_spot_age=config["max-spot-age-sec"])
cleanup_timer = CleanupTimer(spot_list=spot_list, cleanup_interval=60, max_spot_age=MAX_SPOT_AGE)
cleanup_timer.start()
# Set up web server
web_server = WebServer(spot_list=spot_list, status_data=status_data, port=config["web-server-port"])
web_server = WebServer(spot_list=spot_list, status_data=status_data, port=WEB_SERVER_PORT)
web_server.start()
logging.info("Startup complete.")