fix(apply): foreground every product update

This commit is contained in:
chengma
2026-07-11 22:30:19 +08:00
parent 9ac44bdce2
commit 6979710088
6 changed files with 12 additions and 21 deletions
+1 -14
View File
@@ -953,8 +953,6 @@ class ApplyWorker(BaseWorker):
self._current_batch_size = None
self._batch_count = 0
self._progress_lock = threading.Lock()
self._foreground_lock = threading.Lock()
self._foregrounded_aliases = set()
self.diagnostic_log_dir = diagnostic_log_dir
self._run_id = None
@@ -1287,12 +1285,11 @@ class ApplyWorker(BaseWorker):
db.mark_running(task.id, "apply", path=self.db_path)
self.row_updated.emit(task.id, {"status": "running", "last_error": None})
current_step = "apply_task"
bring_to_front = self._should_bring_account_to_front(account)
result = editor.apply_task(
account,
task,
on_step=on_step,
bring_to_front=bring_to_front,
bring_to_front=True,
update_mode=self.update_mode,
)
committed = bool(result.get("committed")) and not result.get("error")
@@ -1374,16 +1371,6 @@ class ApplyWorker(BaseWorker):
)
return "failed"
def _should_bring_account_to_front(self, account):
alias = str(getattr(account, "alias", "") or "").strip()
if not alias:
return True
with self._foreground_lock:
if alias in self._foregrounded_aliases:
return False
self._foregrounded_aliases.add(alias)
return True
def _record_outcome(self, counters, total, outcome):
with self._progress_lock:
counters["done"] += 1