mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
chore: add proper-lockfile for safe database read/write operations and implement retry logic for file access
This commit is contained in:
@@ -60,12 +60,19 @@ export const MEMORY_CONFIG = {
|
||||
export const DEFAULT_MAX_TOKENS = 64000;
|
||||
export const DEFAULT_MIN_TOKENS = 32000;
|
||||
|
||||
// Retry config for 429 responses
|
||||
// Retry config for 429 responses (legacy - kept for backward compatibility)
|
||||
export const RETRY_CONFIG = {
|
||||
maxAttempts: 2,
|
||||
delayMs: 2000
|
||||
};
|
||||
|
||||
// Default retry config by status code (number of retry attempts)
|
||||
export const DEFAULT_RETRY_CONFIG = {
|
||||
429: 2, // Rate limit - retry 2 times
|
||||
503: 0, // Service unavailable - no retry
|
||||
502: 0 // Bad gateway - no retry
|
||||
};
|
||||
|
||||
// Exponential backoff config for rate limits
|
||||
export const BACKOFF_CONFIG = {
|
||||
base: 1000,
|
||||
|
||||
Reference in New Issue
Block a user