1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Ping interval (#2321)

* fix #1598 fix #2276 - add `pingInterval` to client config

* setPingTimer on ready (instead of on connect)

* use isReady (instead of isOpen) and fix test

* Update client-configuration.md
This commit is contained in:
Leibale Eidelman
2022-11-10 03:49:56 -05:00
committed by GitHub
parent e0e96aef2a
commit 3c2f7ab92a
3 changed files with 34 additions and 1 deletions

View File

@@ -862,4 +862,16 @@ describe('Client', () => {
client.unref();
client.ref();
}, GLOBAL.SERVERS.OPEN);
testUtils.testWithClient('pingInterval', async client => {
assert.deepEqual(
await once(client, 'ping-interval'),
['PONG']
);
}, {
...GLOBAL.SERVERS.OPEN,
clientOptions: {
pingInterval: 1
}
});
});