@@ -63,7 +63,7 @@ function RedisClient (options, stream) {
63
63
cnx_options . family = ( ! options . family && net . isIP ( cnx_options . host ) ) || ( options . family === 'IPv6' ? 6 : 4 ) ;
64
64
this . address = cnx_options . host + ':' + cnx_options . port ;
65
65
}
66
- /* istanbul ignore next: travis does not work with stunnel atm. Therefor the tls tests are skipped on travis */
66
+ /* istanbul ignore next: travis does not work with stunnel atm. Therefore the tls tests are skipped on travis */
67
67
for ( var tls_option in options . tls ) { // jshint ignore: line
68
68
cnx_options [ tls_option ] = options . tls [ tls_option ] ;
69
69
}
@@ -220,7 +220,7 @@ RedisClient.prototype.create_stream = function () {
220
220
this . stream . destroy ( ) ;
221
221
}
222
222
223
- /* istanbul ignore if: travis does not work with stunnel atm. Therefor the tls tests are skipped on travis */
223
+ /* istanbul ignore if: travis does not work with stunnel atm. Therefore the tls tests are skipped on travis */
224
224
if ( this . options . tls ) {
225
225
this . stream = tls . connect ( this . connection_options ) ;
226
226
} else {
@@ -230,12 +230,13 @@ RedisClient.prototype.create_stream = function () {
230
230
231
231
if ( this . options . connect_timeout ) {
232
232
this . stream . setTimeout ( this . connect_timeout , function ( ) {
233
+ // Note: This is only tested if a internet connection is established
233
234
self . retry_totaltime = self . connect_timeout ;
234
235
self . connection_gone ( 'timeout' , new Error ( 'Redis connection gone from timeout event' ) ) ;
235
236
} ) ;
236
237
}
237
238
238
- /* istanbul ignore next: travis does not work with stunnel atm. Therefor the tls tests are skipped on travis */
239
+ /* istanbul ignore next: travis does not work with stunnel atm. Therefore the tls tests are skipped on travis */
239
240
var connect_event = this . options . tls ? 'secureConnect' : 'connect' ;
240
241
this . stream . once ( connect_event , function ( ) {
241
242
this . removeAllListeners ( 'timeout' ) ;
@@ -244,7 +245,7 @@ RedisClient.prototype.create_stream = function () {
244
245
} ) ;
245
246
246
247
this . stream . on ( 'data' , function ( buffer_from_socket ) {
247
- // The buffer_from_socket.toString() has a significant impact on big chunks and therefor this should only be used if necessary
248
+ // The buffer_from_socket.toString() has a significant impact on big chunks and therefore this should only be used if necessary
248
249
debug ( 'Net read ' + self . address + ' id ' + self . connection_id ) ; // + ': ' + buffer_from_socket.toString());
249
250
self . reply_parser . execute ( buffer_from_socket ) ;
250
251
self . emit_idle ( ) ;
@@ -400,12 +401,12 @@ RedisClient.prototype.on_ready = function () {
400
401
this . pub_sub_mode = this . old_state . pub_sub_mode ;
401
402
}
402
403
if ( this . monitoring ) { // Monitor has to be fired before pub sub commands
403
- this . internal_send_command ( 'monitor' , [ ] ) ;
404
+ this . internal_send_command ( 'monitor' , [ ] ) ; // The state is still set
404
405
}
405
406
var callback_count = Object . keys ( this . subscription_set ) . length ;
406
407
if ( ! this . options . disable_resubscribing && callback_count ) {
407
408
// only emit 'ready' when all subscriptions were made again
408
- // TODO: Remove the countdown for ready here. This is not coherent with all other modes and should therefor not be handled special
409
+ // TODO: Remove the countdown for ready here. This is not coherent with all other modes and should therefore not be handled special
409
410
// We know we are ready as soon as all commands were fired
410
411
var callback = function ( ) {
411
412
callback_count -- ;
@@ -680,7 +681,7 @@ function subscribe_unsubscribe (self, reply, type, subscribe) {
680
681
} else {
681
682
var running_command ;
682
683
var i = 1 ;
683
- // This should be a rare case and therefor handling it this way should be good performance wise for the general case
684
+ // This should be a rare case and therefore handling it this way should be good performance wise for the general case
684
685
while ( running_command = self . command_queue . get ( i ) ) {
685
686
if ( SUBSCRIBE_COMMANDS [ running_command . command ] ) {
686
687
self . command_queue . shift ( ) ;
0 commit comments