mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 10:00:34 +02:00
Store: publish a search's completion and hand over its queue atomically
A query arriving between the queue handover and the completion event could be queued with nobody to start it, leaving the source 'loading' forever. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5ac109c381
commit
4fd8bb79af
2 files changed
+24
-2
No files matched your search
@@ -249,11 +249,11 @@ def _start(key, task):
|
||||
task['error'] = str(e)
|
||||
task['limited'] = isinstance(e, SourceLimited)
|
||||
finally:
|
||||
with _lock:
|
||||
with _lock: # completion and queue handover are one step for _launch
|
||||
queued = _pending.pop(key, None)
|
||||
if queued:
|
||||
_running[key] = queued
|
||||
task['event'].set()
|
||||
task['event'].set()
|
||||
if queued:
|
||||
_start(key, queued)
|
||||
threading.Thread(target=run, daemon=True).start()
|
||||
|
||||
Reference in new issue
Block a user