MCPcopy Create free account
hub / github.com/porsager/postgres / terminate

Function terminate

cjs/src/connection.js:422–434  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

420 }
421
422 function terminate() {
423 terminated = true
424 if (stream || query || initial || sent.length)
425 error(Errors.connection('CONNECTION_DESTROYED', options))
426
427 clearImmediate(nextWriteTimer)
428 if (socket) {
429 socket.removeListener('data', data)
430 socket.removeListener('connect', connected)
431 socket.readyState === 'open' && socket.end(b().X().end())
432 }
433 ended && (ended(), ending = ended = null)
434 }
435
436 async function closed(hadError) {
437 incoming = Buffer.alloc(0)

Callers 2

endFunction · 0.70
ReadyForQueryFunction · 0.70

Calls 3

errorFunction · 0.70
endMethod · 0.65
clearImmediateFunction · 0.50

Tested by

no test coverage detected