Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aletorrado committed Dec 12, 2014
1 parent 46459ff commit 80f2318
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/caching.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ var caching = function (args) {

self.queues[key] = [cb];

function fillCallbacks(err, data){
self.queues[key].forEach(function(f){
function fillCallbacks(err, data) {
self.queues[key].forEach(function(f) {
f(err, data);
});
delete self.queues[key];
Expand All @@ -69,7 +69,7 @@ var caching = function (args) {
if (err && (!self.ignoreCacheErrors)) {
fillCallbacks(err);
} else {
fillCallbacks(err, data);
fillCallbacks(null, data);
}
});
});
Expand Down
12 changes: 8 additions & 4 deletions lib/multi_caching.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ var multi_caching = function (caches) {

self.queues[key] = [cb];

function fillCallbacks(err, data){
self.queues[key].forEach(function(f){
function fillCallbacks(err, data) {
self.queues[key].forEach(function(f) {
f(err, data);
});
delete self.queues[key];
Expand All @@ -77,7 +77,7 @@ var multi_caching = function (caches) {
} else {
work(function (err, data) {
if (err) {
fillCallbacks(err, data);
fillCallbacks(err, null);
return;
}
var opts = {
Expand All @@ -86,7 +86,11 @@ var multi_caching = function (caches) {
ttl: ttl
};
set_in_multiple_caches(caches, opts, function (err) {
fillCallbacks(null, data);
if (err) {
fillCallbacks(err);
} else {
fillCallbacks(null, data);
}
});
});
}
Expand Down

0 comments on commit 80f2318

Please sign in to comment.