File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/client/lib/client Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -825,6 +825,7 @@ export default class RedisClient<
825
825
*/
826
826
QUIT ( ) : Promise < string > {
827
827
return this . _socket . quit ( async ( ) => {
828
+ clearTimeout ( this . _pingTimer ) ;
828
829
const quitPromise = this . _queue . addCommand < string > ( [ 'QUIT' ] ) ;
829
830
this . _tick ( ) ;
830
831
return quitPromise ;
@@ -845,6 +846,7 @@ export default class RedisClient<
845
846
*/
846
847
close ( ) {
847
848
return new Promise < void > ( resolve => {
849
+ clearTimeout ( this . _pingTimer ) ;
848
850
this . _socket . close ( ) ;
849
851
850
852
if ( this . _queue . isEmpty ( ) ) {
@@ -855,18 +857,19 @@ export default class RedisClient<
855
857
const maybeClose = ( ) => {
856
858
if ( ! this . _queue . isEmpty ( ) ) return ;
857
859
858
- this . _socket . off ( 'data' , maybeClose ) ;
860
+ this . _socket . removeEventListener ( 'data' , maybeClose ) ;
859
861
this . _socket . destroySocket ( ) ;
860
862
resolve ( ) ;
861
863
} ;
862
- this . _socket . on ( 'data' , maybeClose ) ;
864
+ this . _socket . addEventListener ( 'data' , maybeClose ) ;
863
865
} ) ;
864
866
}
865
867
866
868
/**
867
869
* Destroy the client. Rejects all commands immediately.
868
870
*/
869
871
destroy ( ) {
872
+ clearTimeout ( this . _pingTimer ) ;
870
873
this . _queue . flushAll ( new DisconnectsClientError ( ) ) ;
871
874
this . _socket . destroy ( ) ;
872
875
}
You can’t perform that action at this time.
0 commit comments