T-580 精简设置页更新执行配置
This commit is contained in:
+8
-11
@@ -573,10 +573,8 @@ class ApplyWorker(BaseWorker):
|
||||
db_path=None,
|
||||
config=None,
|
||||
preflight=True,
|
||||
close_success_tab=False,
|
||||
dry_run=False,
|
||||
update_mode=None,
|
||||
parallel_accounts=False,
|
||||
max_parallel_accounts=1,
|
||||
batch_size=None,
|
||||
diagnostic_log_dir=None,
|
||||
@@ -586,14 +584,15 @@ class ApplyWorker(BaseWorker):
|
||||
self.db_path = db_path
|
||||
self.config = config
|
||||
self.preflight = preflight
|
||||
self.close_success_tab = close_success_tab
|
||||
self.dry_run = bool(dry_run)
|
||||
self.update_mode = appconfig.normalize_update_mode(
|
||||
update_mode,
|
||||
allow_cover_update=appconfig.shopee_update_config(config).get("allow_cover_update", False),
|
||||
)
|
||||
self.parallel_accounts = bool(parallel_accounts)
|
||||
self.max_parallel_accounts = max(1, int(max_parallel_accounts or 1))
|
||||
self.max_parallel_accounts = max(
|
||||
appconfig.SHOPEE_PARALLEL_ACCOUNTS_MIN,
|
||||
min(appconfig.SHOPEE_PARALLEL_ACCOUNTS_MAX, int(max_parallel_accounts or 1)),
|
||||
)
|
||||
self.batch_size = None if batch_size is None else max(1, int(batch_size or 1))
|
||||
self._current_batch_size = None
|
||||
self._batch_count = 0
|
||||
@@ -633,7 +632,7 @@ class ApplyWorker(BaseWorker):
|
||||
batch_count=len(batches),
|
||||
parallel=(
|
||||
f"多账号并行最多{self.max_parallel_accounts}"
|
||||
if self.parallel_accounts
|
||||
if self.max_parallel_accounts > 1
|
||||
else "串行"
|
||||
),
|
||||
)
|
||||
@@ -671,7 +670,7 @@ class ApplyWorker(BaseWorker):
|
||||
break
|
||||
outcome = self._preview_task(task, account_by_alias)
|
||||
self._record_outcome(counters, total, outcome)
|
||||
elif self.parallel_accounts and self.max_parallel_accounts > 1:
|
||||
elif self.max_parallel_accounts > 1:
|
||||
self._run_parallel_by_account(batch_tasks, account_by_alias, counters, total)
|
||||
else:
|
||||
for task in batch_tasks:
|
||||
@@ -936,7 +935,6 @@ class ApplyWorker(BaseWorker):
|
||||
result = editor.apply_task(
|
||||
account,
|
||||
task,
|
||||
close_success_tab=self.close_success_tab,
|
||||
on_step=on_step,
|
||||
bring_to_front=bring_to_front,
|
||||
update_mode=self.update_mode,
|
||||
@@ -1103,7 +1101,7 @@ class ApplyWorker(BaseWorker):
|
||||
"failed": counters["failed"],
|
||||
"batch_ids": batch_ids,
|
||||
"dry_run": self.dry_run,
|
||||
"parallel_accounts": self.parallel_accounts,
|
||||
"account_parallel": self.max_parallel_accounts > 1,
|
||||
"batch_size": self._current_batch_size,
|
||||
"batch_count": self._batch_count,
|
||||
"update_mode": self.update_mode,
|
||||
@@ -1123,9 +1121,8 @@ class ApplyWorker(BaseWorker):
|
||||
total=len(eligible),
|
||||
options={
|
||||
"batch_ids": batch_ids,
|
||||
"close_success_tab": self.close_success_tab,
|
||||
"dry_run": self.dry_run,
|
||||
"parallel_accounts": self.parallel_accounts,
|
||||
"account_parallel": self.max_parallel_accounts > 1,
|
||||
"max_parallel_accounts": self.max_parallel_accounts,
|
||||
"batch_size": self._current_batch_size,
|
||||
"batch_count": self._batch_count,
|
||||
|
||||
Reference in New Issue
Block a user