diff --git a/src/pool.ts b/src/pool.ts index 8a0bdcf..f1de757 100644 --- a/src/pool.ts +++ b/src/pool.ts @@ -24,6 +24,12 @@ export class PoolConnection extends Connection { log.warning(`error closing idle connection`, error); } }, this.config.idleTimeout); + try { + // Don't block the event loop from finishing + Deno.unrefTimer(this._idleTimer); + } catch (_error) { + // unrefTimer() is unstable API in older version of Deno + } } }