File tree Expand file tree Collapse file tree 3 files changed +8
-25
lines changed
Expand file tree Collapse file tree 3 files changed +8
-25
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,15 @@ const connectionString = env.DATABASE_URL
1313const socketDb = drizzle (
1414 postgres ( connectionString , {
1515 prepare : false ,
16- idle_timeout : 10 ,
17- connect_timeout : 20 ,
18- max : 15 ,
16+ idle_timeout : 20 ,
17+ connect_timeout : 10 ,
18+ max : 5 ,
1919 onnotice : ( ) => { } ,
2020 } ) ,
2121 { schema }
2222)
2323
24- // Use dedicated connection for socket operations, fallback to shared db for compatibility
24+ // Use dedicated connection for socket operations
2525const db = socketDb
2626
2727// Constants
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ const connectionString = env.DATABASE_URL
1111const db = drizzle (
1212 postgres ( connectionString , {
1313 prepare : false ,
14- idle_timeout : 15 ,
15- connect_timeout : 20 ,
14+ idle_timeout : 20 ,
15+ connect_timeout : 10 ,
1616 max : 3 ,
1717 onnotice : ( ) => { } ,
1818 } ) ,
Original file line number Diff line number Diff line change @@ -10,28 +10,11 @@ if (!connectionString) {
1010 throw new Error ( 'Missing DATABASE_URL environment variable' )
1111}
1212
13- console . log (
14- '[DB Pool Init]' ,
15- JSON . stringify ( {
16- timestamp : new Date ( ) . toISOString ( ) ,
17- nodeEnv : process . env . NODE_ENV ,
18- action : 'CREATING_CONNECTION_POOL' ,
19- poolConfig : {
20- max : 30 ,
21- idle_timeout : 20 ,
22- connect_timeout : 30 ,
23- prepare : false ,
24- } ,
25- pid : process . pid ,
26- isProduction : process . env . NODE_ENV === 'production' ,
27- } )
28- )
29-
3013const postgresClient = postgres ( connectionString , {
3114 prepare : false ,
3215 idle_timeout : 20 ,
33- connect_timeout : 30 ,
34- max : 30 ,
16+ connect_timeout : 10 ,
17+ max : 20 ,
3518 onnotice : ( ) => { } ,
3619} )
3720
You can’t perform that action at this time.
0 commit comments