MCPcopy Create free account
hub / github.com/effect-app/libs / cleanup

Function cleanup

repos/effect/packages/sql/pg/src/PgClient.ts:307–311  ·  view source on GitHub ↗
(cause?: Error)

Source from the content-addressed store, hash-verified

305 let done = false
306 let cancel: Effect.Effect<void> | undefined = undefined
307 let client: Pg.PoolClient | undefined = undefined
308 function onError(cause: Error) {
309 cleanup(cause)
310 resume(Effect.fail(new SqlError({ reason: classifyError(cause, "Connection error", "acquireConnection") })))
311 }
312 function cleanup(cause?: Error) {
313 if (!done) client?.release(cause)
314 done = true

Callers 5

onErrorFunction · 0.70
makeConectionFunction · 0.70
onMountedWithCleanupFunction · 0.50
vitest.setup.tsFile · 0.50
vitest.setup.tsFile · 0.50

Calls 1

releaseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…