1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-12-20 16:41:13 -05:00

Added SIGTERM to signal_handler

This commit is contained in:
Hemna 2021-10-20 15:20:08 -04:00
parent 0d51634ec2
commit 8ee8b149f1
2 changed files with 8 additions and 8 deletions

View File

@ -432,6 +432,7 @@ def server(
"""Start the aprsd server process."""
global flask_enabled
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
if not quiet:
click.echo("Load config")
@ -481,6 +482,7 @@ def server(
messaging.MsgTrack().flush()
packets.PacketList(config=config)
packets.WatchList(config=config)
packets.SeenList(config=config)
else:
# Try and load saved MsgTrack list
LOG.debug("Loading saved MsgTrack object.")

View File

@ -76,7 +76,9 @@ class WatchList(objectstore.ObjectStoreMixin):
if cls._instance is None:
cls._instance = super().__new__(cls)
cls._instance.lock = threading.Lock()
cls.data = {}
cls._instance.config = kwargs["config"]
cls._instance.data = {}
cls._instance._init_store()
return cls._instance
def __init__(self, config=None):
@ -97,7 +99,6 @@ class WatchList(objectstore.ObjectStoreMixin):
ring_size,
),
}
self._init_store()
def is_enabled(self):
if self.config and "watch_list" in self.config["aprsd"]:
@ -163,14 +164,11 @@ class SeenList(objectstore.ObjectStoreMixin):
if cls._instance is None:
cls._instance = super().__new__(cls)
cls._instance.lock = threading.Lock()
cls.data = {}
cls._instance.config = kwargs["config"]
cls._instance.data = {}
cls._instance._init_store()
return cls._instance
def __init__(self, config=None):
if config:
self.config = config
self._init_store()
def update_seen(self, packet):
callsign = None
if "fromcall" in packet: