From 4e2e3d8f61ca35cb7873dc53199d71b69baf00bd Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Sat, 4 Oct 2025 01:50:31 +1000 Subject: [PATCH] [Bugfix] Fix race starting journal monitor Fixes a race identified where long plugin init times can result in the following error being thrown in the journal monitor thread, requiring a preferences reload to have journals continuing to be processed: ``` Exception in thread Journal worker: Traceback (most recent call last): File "/home/testing/.pyenv/versions/3.11.9/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() File "/home/testing/.pyenv/versions/3.11.9/lib/python3.11/threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "/home/testing/gitstuff/EDMarketConnector/monitor.py", line 461, in worker self.root.event_generate('<>', when="tail") File "/home/testing/.pyenv/versions/3.11.9/lib/python3.11/tkinter/__init__.py", line 1933, in event_generate self.tk.call(args) RuntimeError: main thread is not in main loop ``` --- EDMarketConnector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 1b45225a..54d84ef8 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -754,7 +754,7 @@ class AppWindow: config.delete('username', suppress=True) config.delete('password', suppress=True) config.delete('logdir', suppress=True) - self.postprefs(False) # Companion login happens in callback from monitor + self.w.after_idle(lambda: self.postprefs(False)) # Companion login happens in callback from monitor self.toggle_suit_row(visible=False) if args.start_min: logger.warning("Trying to start minimized")