Disable SIGCHLD Handler for now - keeping SIGTERM for DB writes

This commit is contained in:
dgtlmoon
2022-08-04 23:48:36 +02:00
parent f0f2fe94ce
commit e318253f31
2 changed files with 8 additions and 6 deletions

View File

@@ -19,11 +19,10 @@ app = None
def sigterm_handler(_signo, _stack_frame):
global app
global datastore
app.config.exit.set()
datastore.sync_to_json()
# app.config.exit.set()
print('Shutdown: Got SIGTERM, DB saved to disk')
raise SystemExit
datastore.sync_to_json()
# raise SystemExit
def main():
global datastore
@@ -91,6 +90,7 @@ def main():
datastore = store.ChangeDetectionStore(datastore_path=app_config['datastore_path'], version_tag=__version__)
app = changedetection_app(app_config, datastore)
signal.signal(signal.SIGTERM, sigterm_handler)
# Go into cleanup mode