Browse Source

changing async.forEach to each and async.forEachSeries to eachSeries

feature/specify-what-to-cache
Bryan Donovan 10 years ago
parent
commit
6fc00781c7
  1. 8
      lib/multi_caching.js

8
lib/multi_caching.js

@ -20,7 +20,7 @@ var multi_caching = function(caches) {
} }
var i = 0; var i = 0;
async.forEachSeries(caches, function(cache, async_cb) { async.eachSeries(caches, function(cache, async_cb) {
var callback = function(err, result) { var callback = function(err, result) {
if (err) { if (err) {
return cb(err); return cb(err);
@ -42,7 +42,7 @@ var multi_caching = function(caches) {
} }
function set_in_multiple_caches(caches, opts, cb) { function set_in_multiple_caches(caches, opts, cb) {
async.forEach(caches, function(cache, async_cb) { async.each(caches, function(cache, async_cb) {
if (typeof opts.options !== 'object') { if (typeof opts.options !== 'object') {
cache.store.set(opts.key, opts.value, opts.ttl, async_cb); cache.store.set(opts.key, opts.value, opts.ttl, async_cb);
} else { } else {
@ -66,7 +66,7 @@ var multi_caching = function(caches) {
if (result !== undefined && index) { if (result !== undefined && index) {
var cachesToUpdate = caches.slice(0, index); var cachesToUpdate = caches.slice(0, index);
async.forEach(cachesToUpdate, function(cache, async_cb) { async.each(cachesToUpdate, function(cache, async_cb) {
cache.set(key, result, result.ttl, async_cb); cache.set(key, result, result.ttl, async_cb);
}); });
} }
@ -171,7 +171,7 @@ var multi_caching = function(caches) {
cb = options; cb = options;
options = false; options = false;
} }
async.forEach(caches, function(cache, async_cb) { async.each(caches, function(cache, async_cb) {
if (typeof options === 'object') { if (typeof options === 'object') {
cache.store.del(key, options, async_cb); cache.store.del(key, options, async_cb);
} else { } else {

Loading…
Cancel
Save