chore: add proper-lockfile for safe database read/write operations and implement retry logic for file access
This commit is contained in:
@@ -33,6 +33,7 @@ export const PROVIDERS = {
|
||||
claude: {
|
||||
baseUrl: "https://api.anthropic.com/v1/messages",
|
||||
format: "claude",
|
||||
retry: { 429: 0 },
|
||||
headers: {
|
||||
"Anthropic-Version": "2023-06-01",
|
||||
"Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05",
|
||||
|
||||
@@ -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