Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('many gets on uncached key from a single instance result in only one db fetch', function(done) {
var numGets = 100;
var fetches = 0;
var doGet = function(n, next) {
stash.get('hotKey', function(cb) {
assert.equal(1, (++fetches));
return setImmediate(function() {
cb(null, { test: 2 });
});
}, next);
};
async.times(numGets, doGet, function(err, results) {
assert(!err);
assert.equal(numGets, results.length);
done();
});
});
"terms": ["inputs", "weights", function(results, callback) {
async.times(results.inputs.length, function(index, callback) {
callback(null, results.inputs[index] * results.weights[index])
}, callback)
}],
"sum": ["terms", function(results, callback) {
let activate = async.seq((data, callback) => {
async.times(i.length, (index, callback) => {
i[index].activate(data[index], callback)
}, callback)
}, (a, callback) => {
async.times(h.length, (index, callback) => {
'neo-async_v0': function(callback) {
neo_async_v0.times(count, iterator, callback);
},
'neo-async_v1': function(callback) {