fix: keep cold Find Work reliable across workers (Closes #695)
CI / lint (pull_request) Successful in 1m34s
CI / build-release (pull_request) Successful in 6s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy committed 2026-08-13 01:22:42 +00:00
1 parent 47c6412a12
commit df8385b325
3 files changed
+87 -4

No files matched your search

+7 -3
View File
@@ -2767,14 +2767,18 @@ async def _available_issue_snapshot() -> tuple[list[dict], bool, bool, bool]:
if _available_issue_snapshot_value is not None:
return _available_issue_snapshot_value, True, True, False
if not local_refresh:
for _ in range(50):
wait_deadline = time.monotonic() + WORK_PAGE_TIMEOUT_SECONDS
while time.monotonic() < wait_deadline:
await asyncio.sleep(0.02)
shared = await asyncio.to_thread(_available_issue_snapshot_store.load)
if shared.items is not None:
return shared.items, False, False, False
if not shared.refreshing:
break
raise RuntimeError("available issue catalog refresh is owned by another worker")
local_refresh = await _start_available_issue_refresh()
if local_refresh:
break
if not local_refresh:
raise RuntimeError("available issue catalog refresh is owned by another worker")
try:
return await asyncio.shield(_available_issue_snapshot_task), False, False, False
except Exception: