allow monitor to be skipped when not defined
thrrgilag/clacksme/pipeline/head This commit looks good Details

closes issue #3
This commit is contained in:
Morgan McMillian 2024-01-28 06:19:37 -08:00
parent 6f836b63f7
commit c17c5b61c4
1 changed files with 9 additions and 2 deletions

View File

@ -192,7 +192,14 @@ def main():
db.init(args.store, pragmas={'journal_mode': 'wal'})
create_tables()
monitor_url = System.get_or_none(System.key == "monitor_url")
monitor_url_check = System.get_or_none(System.key == "monitor_url")
if monitor_url_check is None:
monitor_url = None
else:
if len(monitor_url_check.value) < 8:
monitor_url = None
else:
monitor_url = monitor_url_check.value
log_queue = Queue()
event_queue = Queue()
@ -209,7 +216,7 @@ def main():
logging.basicConfig(level=logging.DEBUG)
logging.debug("starting up main")
log_thread = threading.Thread(target=logger_thread,
args=(log_queue,monitor_url.value,))
args=(log_queue,monitor_url,))
log_thread.start()
e_thread = threading.Thread(target=event_thread, args=(event_queue,))
e_thread.start()