fix: retry catalog when the blocking process exits

This commit is contained in:
阿白叔 committed 2026-11-25 12:03:05 +08:00
1 parent 75612cd4da
commit b015827e97
2 files changed
+37 -5

No files matched your search

+4 -5
View File
@@ -1543,7 +1543,7 @@ class MainWindow(QWidget):
def scan():
from cbb_refresh_verify.native_management import NativeOperationError
from cbb_refresh_verify.owner_probe import query_owners
from cbb_refresh_verify.owner_probe import snapshot_process_ids
try:
return attempt(root)
@@ -1556,13 +1556,12 @@ class MainWindow(QWidget):
while time.monotonic() < deadline:
context.check_active()
try:
owners = query_owners(('LibraryManager.exe',),
timeout_seconds=min(2, max(.1, deadline - time.monotonic())))
except (OSError, RuntimeError):
owners = snapshot_process_ids('LibraryManager.exe')
except OSError:
context.stop.wait(1)
continue
context.check_active()
if not owners or blockers and blockers.isdisjoint(owner['pid'] for owner in owners):
if not owners or blockers and blockers.isdisjoint(owners):
return attempt(root/'retry')
context.stop.wait(1)
context.check_active()