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) {
101101 if ( options . socket_keepalive === undefined ) {
102102 options . socket_keepalive = true ;
103103 }
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+ }
104108 for ( var command in options . rename_commands ) {
105109 options . rename_commands [ command . toLowerCase ( ) ] = options . rename_commands [ command ] ;
106110 }
@@ -416,7 +420,7 @@ RedisClient.prototype.on_connect = function () {
416420 this . connected = true ;
417421 this . ready = false ;
418422 this . emitted_end = false ;
419- this . stream . setKeepAlive ( this . options . socket_keepalive ) ;
423+ this . stream . setKeepAlive ( this . options . socket_keepalive , this . options . socket_initialdelay ) ;
420424 this . stream . setTimeout ( 0 ) ;
421425
422426 this . emit ( 'connect' ) ;
You can’t perform that action at this time.
0 commit comments