tim-kos / node-retry

Abstraction for exponential and custom retry strategies for failed operations.
Other
1.22k stars 80 forks source link

[Bug] RetryOperation does not free errors correctly, causing "forever" operations to leak memory #60

Open atondelier opened 6 years ago

atondelier commented 6 years ago

Hi,

It appears to me that the following splice call

      // retry forever, only keep last error
      this._errors.splice(this._errors.length - 1, this._errors.length);

is not doing what it says it does. It actually only removes the last element of _errors.

Since it has been there for 3 years and nobody complaining about it, I prefer checking with you before if:

Thanks for the great work.