tim-kos/node-retry

Missing current attempt in callback

hornta opened this issue · 0 comments

Isn't the current attempt missing when executing this callback right here?

self._operationTimeoutCb();


I also found this line which confuses me. The readme says nothing about an option called forever in the timeouts function and I'm unsure if it's a miss in the readme or in the code.

if (options && options.forever && !timeouts.length) {

https://github.com/tim-kos/node-retry#retrytimeoutsoptions


The timeout variable is used as the timeout in a setTimeout but this line right here sets timeout to an array of size 1 but setTimeout doesn't accept an array as a second argument.

timeout = this._cachedTimeouts.slice(-1);

}, timeout);

Couldn't this cause unwanted behaviour?