mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-13 16:07:30 +00:00
Bring back cleanup thread
This commit is contained in:
@@ -4,6 +4,7 @@ import os
|
||||
import signal
|
||||
import sys
|
||||
|
||||
from core.cleanup import CLEANUP_TIMER
|
||||
from core.config import SERVER_OWNER_CALLSIGN, LOG_LEVEL
|
||||
from core.constants import SOFTWARE_VERSION
|
||||
from core.data_providers import DATA_PROVIDERS
|
||||
@@ -22,6 +23,7 @@ def shutdown(_signum=None, _frame=None):
|
||||
logging.info("Stopping program...")
|
||||
WEB_SERVER.stop()
|
||||
DATA_PROVIDERS.stop()
|
||||
CLEANUP_TIMER.stop()
|
||||
DATA_STORE.close()
|
||||
os._exit(0)
|
||||
|
||||
@@ -47,6 +49,8 @@ if __name__ == '__main__':
|
||||
|
||||
# Set up data store
|
||||
DATA_STORE.setup()
|
||||
CLEANUP_TIMER.setup(cleanup_interval=60)
|
||||
CLEANUP_TIMER.start()
|
||||
|
||||
# Set up and start data providers
|
||||
DATA_PROVIDERS.setup()
|
||||
|
||||
Reference in New Issue
Block a user