MCPcopy
hub / github.com/redis/node-redis / #cleanup

Method #cleanup

packages/client/lib/client/pool.ts:539–546  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

537 }
538
539 #cleanup() {
540 const toDestroy = Math.min(this.#idleClients.length, this.totalClients - this.#options.minimum);
541 for (let i = 0; i < toDestroy; i++) {
542 // TODO: shift vs pop
543 const client = this.#idleClients.shift()!
544 client.destroy();
545 }
546 }
547
548 sendCommand(
549 args: Array<RedisArgument>,

Callers 1

#scheduleCleanupMethod · 0.95

Calls 2

destroyMethod · 0.65
shiftMethod · 0.45

Tested by

no test coverage detected