Skip to content

Commit

Permalink
Merge pull request #238 from JohnStrunk/sentry-h
Browse files Browse the repository at this point in the history
fix: Process startlists in main thread
  • Loading branch information
mergify[bot] authored Mar 20, 2023
2 parents 8dabc01 + c9e6540 commit 226aab5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wahoo_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def scb_dir_updated() -> None:
if not os.path.exists(path):
return
observer.unschedule_all()
observer.schedule(SCBWatcher(process_startlists), path)
# When the watcher notices a change in the startlists, the update
# needs to happen from the main thread, so we enqueue instead of
# directly call process_startlists from the SCBWatcher.
observer.schedule(SCBWatcher(lambda: model.enqueue(process_startlists)), path)
process_startlists()

model.dir_startlist.trace_add("write", lambda *_: scb_dir_updated())
Expand Down

0 comments on commit 226aab5

Please sign in to comment.