diff --git a/src/utils/wrappa/postgres/write.ts b/src/utils/wrappa/postgres/write.ts index 7b70635..8981b66 100644 --- a/src/utils/wrappa/postgres/write.ts +++ b/src/utils/wrappa/postgres/write.ts @@ -282,7 +282,7 @@ export const closeIdleConnections = async (idleTimeMinutes = 3) => { SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE state = 'idle' - AND state_change < NOW() - INTERVAL '${idleTimeMinutes} minutes' + AND state_change < NOW() - INTERVAL '3 minutes' AND pid <> pg_backend_pid() ) SELECT COUNT(*) as closed_count FROM closed;