Skip to content

Commit 31305df

Browse files
committed
Dont detect error on native bindings right now
1 parent 8a7b43a commit 31305df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/pg-pool/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ class Pool extends EventEmitter {
121121

122122
// TODO(bmc): we need a better state represetation on the client itself
123123
// to indicate if it's connecting, idle, running a query, closed, etc...
124-
// but for now we can look at it's stream.
124+
// as right now this hacky fix will only work for the JS client
125+
// since the native client doesn't _have_ a connection property
126+
125127
// remove this client, it's died in the background - this can happen
126128
// in aws lambdas - they go idle and the streams are closed without an error
127-
if (client.connection.stream.readyState !== 'open') {
129+
if (client.connection && client.connection.stream.readyState !== 'open') {
128130
this._remove(client)
129131
} else {
130132
const idleListener = idleItem.idleListener

0 commit comments

Comments
 (0)