fix(apply): foreground every product update
This commit is contained in:
+1
-14
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user