From d538c7da4f41a44f816bb8f5020ed429f2cf0b7f Mon Sep 17 00:00:00 2001 From: Administrator Date: Mon, 23 Mar 2026 08:03:44 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20account=20fallback=20now?= =?UTF-8?q?=20works=20for=20ALL=20files=20in=20batch,=20not=20just=20first?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Account A failed, only the first file got the fallback to Account B. All subsequent files in the same batch still tried Account A (wasting all retries), then skipped fallback because _failedAccounts already had the key. Now: before the retry loop, each job checks if its account is already known-failed and immediately switches to the fallback account, avoiding wasted retries on a known-bad account. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/upload-manager.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/upload-manager.js b/lib/upload-manager.js index b4dfdd8..247c61f 100644 --- a/lib/upload-manager.js +++ b/lib/upload-manager.js @@ -243,6 +243,18 @@ class UploadManager extends EventEmitter { return; } + // If this account already failed in this batch, switch to fallback immediately + // instead of wasting retries on a known-bad account + if (task.accountId && this._failedAccounts.has(task.hoster + ':' + task.accountId)) { + const override = this._accountOverrides.get(task.hoster); + if (override && !this._failedAccounts.has(task.hoster + ':' + override.id)) { + task.accountId = override.id; + task.username = override.username; + task.password = override.password; + task.apiKey = override.apiKey; + } + } + this._emitProgress(uploadId, fileName, task.hoster, { jobId, status: 'queued',