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

Function terminate

cf/src/connection.js:424–436  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 2

endFunction · 0.70
ReadyForQueryFunction · 0.70

Calls 3

clearImmediateFunction · 0.90
errorFunction · 0.70
endMethod · 0.65

Tested by

no test coverage detected