fix: enhance retry logic and configuration for HTTP status codes

This commit is contained in:
decolua
2026-04-24 10:07:08 +07:00
parent 65f11a603e
commit 0aff9a502c
2 changed files with 20 additions and 12 deletions
+3 -2
View File
@@ -45,8 +45,9 @@ export const RETRY_CONFIG = {
// Backward compat: if value is a number, treated as attempts with RETRY_CONFIG.delayMs
export const DEFAULT_RETRY_CONFIG = {
429: { attempts: 0, delayMs: 0 },
502: { attempts: 1, delayMs: 3000 },
503: { attempts: 1, delayMs: 2000 }
502: { attempts: 3, delayMs: 3000 },
503: { attempts: 3, delayMs: 2000 },
504: { attempts: 2, delayMs: 3000 }
};
// Normalize a retry entry to { attempts, delayMs }