Skip to content

Commit afee387

Browse files
committed
refactor(retry-forever): splice all but last error on forever retry
1 parent 08de0fe commit afee387

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/retry_operation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ RetryOperation.prototype.retry = function(err) {
2727
var timeout = this._timeouts.shift();
2828
if (timeout === undefined) {
2929
if (this._cachedTimeouts) {
30+
// retry forever, only keep last error
31+
this._errors.splice(this._errors.length - 1, this._errors.length);
3032
this._timeouts = this._cachedTimeouts.slice(0);
3133
timeout = this._timeouts.shift();
3234
} else {

0 commit comments

Comments
 (0)