File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ function RedisClient (options, stream) {
101
101
if ( options . socket_keepalive === undefined ) {
102
102
options . socket_keepalive = true ;
103
103
}
104
+ if ( options . socket_initialdelay === undefined ) {
105
+ options . socket_initialdelay = 0 ;
106
+ // set default to 0, which is aligned to https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay
107
+ }
104
108
for ( var command in options . rename_commands ) {
105
109
options . rename_commands [ command . toLowerCase ( ) ] = options . rename_commands [ command ] ;
106
110
}
@@ -416,7 +420,7 @@ RedisClient.prototype.on_connect = function () {
416
420
this . connected = true ;
417
421
this . ready = false ;
418
422
this . emitted_end = false ;
419
- this . stream . setKeepAlive ( this . options . socket_keepalive ) ;
423
+ this . stream . setKeepAlive ( this . options . socket_keepalive , this . options . socket_initialdelay ) ;
420
424
this . stream . setTimeout ( 0 ) ;
421
425
422
426
this . emit ( 'connect' ) ;
You can’t perform that action at this time.
0 commit comments