allow monitor to be skipped when not defined
Some checks failed
thrrgilag/clacksme/pipeline/head This commit looks good
git.dreamfall.space/clacksme/pipeline/head There was a failure building this commit

closes issue #3
This commit is contained in:
Morgan McMillian 2024-01-28 06:19:37 -08:00
parent 6f836b63f7
commit c17c5b61c4

View file

@ -192,7 +192,14 @@ def main():
db.init(args.store, pragmas={'journal_mode': 'wal'}) db.init(args.store, pragmas={'journal_mode': 'wal'})
create_tables() 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() log_queue = Queue()
event_queue = Queue() event_queue = Queue()
@ -209,7 +216,7 @@ def main():
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
logging.debug("starting up main") logging.debug("starting up main")
log_thread = threading.Thread(target=logger_thread, log_thread = threading.Thread(target=logger_thread,
args=(log_queue,monitor_url.value,)) args=(log_queue,monitor_url,))
log_thread.start() log_thread.start()
e_thread = threading.Thread(target=event_thread, args=(event_queue,)) e_thread = threading.Thread(target=event_thread, args=(event_queue,))
e_thread.start() e_thread.start()