File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -625,8 +625,9 @@ export abstract class ClusterAdapterWithHeartbeat extends ClusterAdapter {
625625 }
626626
627627 override serverCount ( ) : Promise < number > {
628+ const now = Date . now ( ) ;
628629 this . nodesMap . forEach ( ( lastSeen , uid ) => {
629- const nodeSeemsDown = Date . now ( ) - lastSeen > this . _opts . heartbeatTimeout ;
630+ const nodeSeemsDown = now - lastSeen > this . _opts . heartbeatTimeout ;
630631 if ( nodeSeemsDown ) {
631632 debug ( "node %s seems down" , uid ) ;
632633 this . nodesMap . delete ( uid ) ;
Original file line number Diff line number Diff line change @@ -908,7 +908,7 @@ export class RedisAdapter extends Adapter {
908908 )
909909 ) . then ( ( values ) => {
910910 let numSub = 0 ;
911- values . map ( ( value ) => {
911+ values . forEach ( ( value ) => {
912912 numSub += parseInt ( value [ 1 ] , 10 ) ;
913913 } ) ;
914914 return numSub ;
Original file line number Diff line number Diff line change @@ -118,11 +118,11 @@ class ShardedRedisAdapter extends ClusterAdapter {
118118 ) {
119119 return Promise . all (
120120 this . pubClient . nodes ( ) . map ( ( node ) => {
121- node . sendCommand ( [ "PUBSUB" , "SHARDNUMSUB" , this . channel ] ) ;
121+ return node . sendCommand ( [ "PUBSUB" , "SHARDNUMSUB" , this . channel ] ) ;
122122 } )
123123 ) . then ( ( values ) => {
124124 let numSub = 0 ;
125- values . map ( ( value ) => {
125+ values . forEach ( ( value ) => {
126126 numSub += parseInt ( value [ 1 ] , 10 ) ;
127127 } ) ;
128128 return numSub ;
You can’t perform that action at this time.
0 commit comments