|
|
@ -1,6 +1,5 @@ |
|
|
|
/** @module cacheManager/multiCaching */ |
|
|
|
var async = require('async'); |
|
|
|
var domain = require('domain'); |
|
|
|
var CallbackFiller = require('./callback_filler'); |
|
|
|
|
|
|
|
/** |
|
|
@ -218,7 +217,7 @@ var multiCaching = function(caches, options) { |
|
|
|
} |
|
|
|
|
|
|
|
var hasKey = callbackFiller.has(key); |
|
|
|
callbackFiller.add(key, {cb: cb, domain: process.domain}); |
|
|
|
callbackFiller.add(key, {cb: cb}); |
|
|
|
if (hasKey) { return; } |
|
|
|
|
|
|
|
getFromHighestPriorityCache(key, function(err, result, index) { |
|
|
@ -232,14 +231,7 @@ var multiCaching = function(caches, options) { |
|
|
|
callbackFiller.fill(key, err, result); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
domain |
|
|
|
.create() |
|
|
|
.on('error', function(err) { |
|
|
|
if (callbackFiller.has(key)) { |
|
|
|
callbackFiller.fill(key, err); |
|
|
|
} |
|
|
|
}) |
|
|
|
.bind(work)(function(err, data) { |
|
|
|
work(function(err, data) { |
|
|
|
if (err) { |
|
|
|
return callbackFiller.fill(key, err); |
|
|
|
} |
|
|
|