Skip to content

Commit

Permalink
add option socket_initialdelay
Browse files Browse the repository at this point in the history
  • Loading branch information
betimer committed Nov 29, 2018
1 parent bd66d62 commit 8ee1b98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -101,6 +101,10 @@ function RedisClient (options, stream) {
if (options.socket_keepalive === undefined) {
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) {
options.rename_commands[command.toLowerCase()] = options.rename_commands[command];
}
Expand Down Expand Up @@ -416,7 +420,7 @@ RedisClient.prototype.on_connect = function () {
this.connected = true;
this.ready = 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.emit('connect');
Expand Down

0 comments on commit 8ee1b98

Please sign in to comment.