From 4c9b6b5ebbb55da8ab10c3f7c5a6c01435248969 Mon Sep 17 00:00:00 2001 From: shportix Date: Fri, 3 Nov 2023 18:10:02 +0200 Subject: [PATCH] must be it --- src/bitmessagemain.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index c58a9b77..3b2033f1 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -11,7 +11,6 @@ The PyBitmessage startup script # yet contain logic to expand into further streams. import os import sys -import logging try: import pathmagic @@ -51,6 +50,10 @@ from threads import ( addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread) +def wait_until_sql_available(): + while not helper_sql.sql_available: + time.sleep(0.25) + def signal_handler(signum, frame): """Single handler for any signal sent to pybitmessage""" process = multiprocessing.current_process() @@ -179,9 +182,8 @@ class Main(object): # The closeEvent should command this thread to exit gracefully. sqlLookup.daemon = False sqlLookup.start() - while not helper_sql.sql_available: - pass + wait_until_sql_available() Inventory() # init