Browse Source

Hint fixes. Removing relaxing options.

feature/specify-what-to-cache
Sean Cady 10 years ago
parent
commit
8ee4c797f2
  1. 23
      lib/multi_caching.js
  2. 2
      test/stores/options.unit.js

23
lib/multi_caching.js

@ -1,5 +1,3 @@
/*jshint -W072 */
var async = require('async');
var domain = require('domain');
@ -22,8 +20,7 @@ var multi_caching = function (caches) {
var i = 0;
async.forEachSeries(caches, function(cache, async_cb) {
if(typeof options === 'object'){
cache.store.get(key, options, function (err, result) {
var callback = function(err, result) {
if (err) {
return cb(err);
}
@ -34,22 +31,12 @@ var multi_caching = function (caches) {
i += 1;
async_cb(err);
});
};
if (typeof options === 'object') {
cache.store.get(key, options, callback);
}else {
cache.store.get(key, function (err, result) {
if (err) {
return cb(err);
cache.store.get(key, callback);
}
if (result) {
// break out of async loop.
return cb(err, result, i);
}
i += 1;
async_cb(err);
});
}
}, cb);
}

2
test/stores/options.unit.js

@ -1,5 +1,3 @@
/*jshint -W072 */
var caching = require("../../index");
var assert = require("assert");
var support = require('../support');

Loading…
Cancel
Save