Merge pull request 'wait for IPC creation' (#18) from fix/ipc-startup into main
Reviewed-on: #18
This commit is contained in:
commit
954bed9e56
@ -201,15 +201,15 @@ def main():
|
|||||||
print("Running in test mode.")
|
print("Running in test mode.")
|
||||||
worker(None, test_mode=True)
|
worker(None, test_mode=True)
|
||||||
return
|
return
|
||||||
|
while True:
|
||||||
try:
|
try:
|
||||||
queue_id = msgget(MSG_QUEUE_KEY, 0)
|
queue_id = msgget(MSG_QUEUE_KEY, 0)
|
||||||
if queue_id == -1:
|
if queue_id == -1:
|
||||||
raise RuntimeError("Failed to connect to the existing message queue.")
|
raise RuntimeError("Failed to connect to the existing message queue.")
|
||||||
|
worker(queue_id)
|
||||||
worker(queue_id)
|
except Exception as e:
|
||||||
except Exception as e:
|
print(f"Main process encountered an error: {e}")
|
||||||
print(f"Main process encountered an error: {e}")
|
time.sleep(30)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user