You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
add option socket_initialdelay
This commit is contained in:
6
index.js
6
index.js
@@ -101,6 +101,10 @@ function RedisClient (options, stream) {
|
|||||||
if (options.socket_keepalive === undefined) {
|
if (options.socket_keepalive === undefined) {
|
||||||
options.socket_keepalive = true;
|
options.socket_keepalive = true;
|
||||||
}
|
}
|
||||||
|
if (options.socket_initialdelay === undefined) {
|
||||||
|
options.socket_initialdelay = 0;
|
||||||
|
// set default to 0, which is aligned to https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay
|
||||||
|
}
|
||||||
for (var command in options.rename_commands) {
|
for (var command in options.rename_commands) {
|
||||||
options.rename_commands[command.toLowerCase()] = options.rename_commands[command];
|
options.rename_commands[command.toLowerCase()] = options.rename_commands[command];
|
||||||
}
|
}
|
||||||
@@ -416,7 +420,7 @@ RedisClient.prototype.on_connect = function () {
|
|||||||
this.connected = true;
|
this.connected = true;
|
||||||
this.ready = false;
|
this.ready = false;
|
||||||
this.emitted_end = false;
|
this.emitted_end = false;
|
||||||
this.stream.setKeepAlive(this.options.socket_keepalive);
|
this.stream.setKeepAlive(this.options.socket_keepalive, this.options.socket_initialdelay);
|
||||||
this.stream.setTimeout(0);
|
this.stream.setTimeout(0);
|
||||||
|
|
||||||
this.emit('connect');
|
this.emit('connect');
|
||||||
|
Reference in New Issue
Block a user