Skip to content

Commit e9ce674

Browse files
committed
added idleTimeoutMillis to postgres.ts + comments
Co-authored-by: Jon Cruz <[email protected]> Co-authored-by: Elena Atencio <[email protected]> Co-authored-by: John Donato <[email protected]>
1 parent 82d5dbe commit e9ce674

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

electron/databases/postgres.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ const connectSQL = async (i: number, URI: string) => {
44
try {
55
const pool= new Pool({
66
connectionString: URI,
7+
idleTimeoutMillis: 2000, // Time after which idle connections are closed
78
})
89
const client = await pool.connect();
9-
client.release()
10+
client.release() // Releases connection back to the pool
1011
console.log('connected to sql')
1112
return pool;
1213
} catch (err) {

0 commit comments

Comments
 (0)