diff --git a/aprsd/main.py b/aprsd/main.py index 2adf64c..f683d66 100644 --- a/aprsd/main.py +++ b/aprsd/main.py @@ -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.") diff --git a/aprsd/packets.py b/aprsd/packets.py index fd0f683..2936b75 100644 --- a/aprsd/packets.py +++ b/aprsd/packets.py @@ -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: