Skip to content

Commit

Permalink
feat: agressively backoff when db connect fails
Browse files Browse the repository at this point in the history
  • Loading branch information
calmdentist committed Dec 5, 2024
1 parent e13b5a7 commit 9fd2629
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/database/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import "dotenv/config";
let connectionString = process.env.FUTARCHY_PG_URL;

// Add retry configuration
const RETRY_ATTEMPTS = 5;
const INITIAL_RETRY_DELAY = 100; // Start with shorter delay
const MAX_RETRY_DELAY = 2000; // Max backoff delay
const RETRY_ATTEMPTS = 12;
const INITIAL_RETRY_DELAY = 1000; // Start with shorter delay
const MAX_RETRY_DELAY = 600000; // Max backoff delay
const ACQUIRE_TIMEOUT = 10000; // 10 second timeout for acquiring connection

// Add connection pool configuration
Expand Down

0 comments on commit 9fd2629

Please sign in to comment.