Getting NPE from retry_attempt.js
cfurst opened this issue · 1 comments
cfurst commented
if (this._options.unref) {
^
TypeError: Cannot read property 'unref' of undefined
retry_operation.js:63:24
sometimes unref is unset. This generally happens when we have many different instances of operation are obtained from retry.operation() calls and one of them is retried. This is in v0.10.1
basically something like:
var retry = require('retry');
function myRetry(simpleFunction) {
// declare options here
var operation = retry.operation(options);
operation.attempt(simpleFunction, timeOutOptions);
}
setInterval(myRetry(function(attempt) {
// ....
}, 1000);
cfurst commented
I see this is fixed in master:
if (self._options.unref) {
self._timeout.unref();
}
instead of
if (this._options.unref) {
self._timeout.unref();
}
is there a release with this change out yet?