globalcache
Advanced tools
Comparing version 2.9.0 to 2.10.0
31
index.js
@@ -70,3 +70,3 @@ var util = require('util'), | ||
}, | ||
_resolveCallback = function (id, err, debug) { | ||
_resolveCallback = function (id, err, debug, send) { | ||
if (callbacks[id]) { | ||
@@ -76,3 +76,3 @@ debug && console.log('node-itach :: status:%s resolving callback with id %s', err ? 'error' : 'success', id); | ||
delete callbacks[id]; | ||
clearSendTimeoutAndSendRightNow(); | ||
send && clearSendTimeoutAndSendRightNow(); | ||
} else { | ||
@@ -170,3 +170,3 @@ console.error('node-itach :: cannot find callback with id %s in callbacks hash', id); | ||
// add rate limiter | ||
return _resolveCallback(id, 'Add Rate Limiter to the blaster', debug); | ||
return _resolveCallback(id, 'Add Rate Limiter to the blaster', debug, true); | ||
} else if (status.match(/^ERR/)) { | ||
@@ -177,6 +177,6 @@ var tmpArr = parts[1].split('IR'); | ||
console.error('node-itach :: error :: ' + data + ': ' + err); | ||
return _resolveCallback(parts[2] || parts[1], err, debug); | ||
} else if (parts[0] === 'setstate') { | ||
_resolveCallback(parts[1], null, debug); | ||
} else if (parts[0] !== 'setstate') { | ||
return _resolveCallback(parts[2] || parts[1], err, debug, true); | ||
} else if (parts[0] === 'setstate' || parts[0] === 'sendir') { | ||
_resolveCallback(parts[1], null, debug, (parts[0] === 'setstate')); | ||
} else { | ||
_resolveCallback(id, null, debug); | ||
@@ -187,11 +187,10 @@ } | ||
isSending = false; | ||
// go to the next message in the queue if any | ||
if (messageQueue.length) { | ||
debug && console.log('Delay before going to another item in a queue...'); | ||
//TODO: test with different equipment, do we really need DELAY_BETWEEN_COMMANDS? | ||
setTimeout(function () { | ||
send_(); | ||
}, DELAY_BETWEEN_COMMANDS); | ||
} | ||
debug && console.log('Delay before going to another item in a queue...'); | ||
setTimeout(function(){ | ||
isSending = false; | ||
// go to the next message in the queue if any | ||
if (messageQueue.length){ | ||
send_(); | ||
} | ||
}, DELAY_BETWEEN_COMMANDS); | ||
}); | ||
@@ -198,0 +197,0 @@ }; |
@@ -43,3 +43,3 @@ { | ||
}, | ||
"version": "2.9.0" | ||
"version": "2.10.0" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
16096
6
226
2