[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('<<JournalEvent>>', 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
```
This commit is contained in:
Ben Peddell committed 2025-10-04 01:50:31 +10:00
1 parent c6f853013e
commit 4e2e3d8f61
1 file changed
+1 -1
+1 -1
View File
@@ -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")