mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-11 06:11:15 +00:00
fix: improve worker error handling and reliability
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
1. Distinguish failure reasons: inspect error messages to label skipped packages as DOWNLOAD_FAILED, UPLOAD_FAILED, or EXTRACT_FAILED instead of catch-all DOWNLOAD_FAILED. 2. Detect orphaned uploads: before uploading, check if the same content hash already has a successful upload on the destination channel. Reuse the existing message ID instead of re-uploading (prevents duplicates when worker crashed between upload and DB write). 3. Increase timeouts: download from max(5min, GB*10min) to max(10min, GB*15min), upload from GB*10min to GB*15min. Prevents premature timeouts on slow connections. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -354,10 +354,10 @@ export async function downloadFile(
|
||||
let lastLoggedPercent = 0;
|
||||
let settled = false;
|
||||
|
||||
// Timeout: 10 minutes per GB, minimum 5 minutes
|
||||
// Timeout: 15 minutes per GB, minimum 10 minutes
|
||||
const timeoutMs = Math.max(
|
||||
5 * 60_000,
|
||||
(totalBytes / (1024 * 1024 * 1024)) * 10 * 60_000
|
||||
10 * 60_000,
|
||||
(totalBytes / (1024 * 1024 * 1024)) * 15 * 60_000
|
||||
);
|
||||
const timer = setTimeout(() => {
|
||||
if (!settled) {
|
||||
|
||||
Reference in New Issue
Block a user