MCPcopy
hub / github.com/redis/node-redis / killClient

Function killClient

packages/client/lib/client/index.spec.ts:893–903  ·  view source on GitHub ↗
(
    client: RedisClientType<{}, {}, {}, 2, {}>,
    errorClient: RedisClientType<{}, {}, {}, 2, {}> = client
  )

Source from the content-addressed store, hash-verified

891 });
892
893 async function killClient(
894 client: RedisClientType<{}, {}, {}, 2, {}>,
895 errorClient: RedisClientType<{}, {}, {}, 2, {}> = client
896 ): Promise<void> {
897 const onceErrorPromise = once(errorClient, 'error');
898 await client.sendCommand(['QUIT']);
899 await Promise.all([
900 onceErrorPromise,
901 assert.rejects(client.ping())
902 ]);
903 }
904
905 testUtils.testWithClient('should reconnect when socket disconnects', async client => {
906 await killClient(client);

Callers 1

index.spec.tsFile · 0.85

Calls 1

sendCommandMethod · 0.45

Tested by

no test coverage detected