File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ function RetryOperation(timeouts, options) {
15
15
this . _operationTimeoutCb = null ;
16
16
this . _timeout = null ;
17
17
this . _operationStart = null ;
18
+ this . _timer = null ;
18
19
19
20
if ( this . _options . forever ) {
20
21
this . _cachedTimeouts = this . _timeouts . slice ( 0 ) ;
@@ -31,6 +32,9 @@ RetryOperation.prototype.stop = function() {
31
32
if ( this . _timeout ) {
32
33
clearTimeout ( this . _timeout ) ;
33
34
}
35
+ if ( this . _timer ) {
36
+ clearTimeout ( this . _timer ) ;
37
+ }
34
38
35
39
this . _timeouts = [ ] ;
36
40
this . _cachedTimeouts = null ;
@@ -65,7 +69,7 @@ RetryOperation.prototype.retry = function(err) {
65
69
}
66
70
67
71
var self = this ;
68
- var timer = setTimeout ( function ( ) {
72
+ this . _timer = setTimeout ( function ( ) {
69
73
self . _attempts ++ ;
70
74
71
75
if ( self . _operationTimeoutCb ) {
@@ -82,7 +86,7 @@ RetryOperation.prototype.retry = function(err) {
82
86
} , timeout ) ;
83
87
84
88
if ( this . _options . unref ) {
85
- timer . unref ( ) ;
89
+ this . _timer . unref ( ) ;
86
90
}
87
91
88
92
return true ;
You can’t perform that action at this time.
0 commit comments