chore: add proper-lockfile for safe database read/write operations and implement retry logic for file access

This commit is contained in:
decolua
2026-03-27 10:31:35 +07:00
parent 3059df4014
commit 8759545260
15 changed files with 648 additions and 57 deletions
+8 -1
View File
@@ -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,