From 969b14db2d4f8a089fb329eb22de70e642d74258 Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Sat, 30 Oct 2021 15:46:03 +0300 Subject: [PATCH] Fixes in shutdown logic during daemon mode --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index 09cf86d..cb3ac44 100644 --- a/main.py +++ b/main.py @@ -197,13 +197,21 @@ if __name__ == '__main__': logger.info('Entering daemon mode') while True: can_be_shutdown = False + update(amount_to_update=500) + if shutting_down: + exit(0) + logger.debug('Updated, sleeping') can_be_shutdown = True time.sleep(30 * 60) can_be_shutdown = False logger.debug('Discovering') + discover() + if shutting_down: + exit(0) + logger.debug('Discovered, sleeping') can_be_shutdown = True time.sleep(30 * 60)