Fix cache usage in layergroup affected tables
This commit is contained in:
parent
4aabe9d946
commit
6d3ef11a7c
@ -243,6 +243,7 @@ LayergroupController.prototype.sendResponse = function(req, res, args) {
|
||||
self.getAffectedTables(req.context.user, dbName, req.params.token, this);
|
||||
},
|
||||
function sendResponse(err, affectedTables) {
|
||||
req.profiler.done('affectedTables');
|
||||
if (err) {
|
||||
console.log('ERROR generating cache channel: ' + err);
|
||||
}
|
||||
@ -258,18 +259,14 @@ LayergroupController.prototype.sendResponse = function(req, res, args) {
|
||||
};
|
||||
|
||||
LayergroupController.prototype.getAffectedTables = function(user, dbName, layergroupId, callback) {
|
||||
|
||||
if (this.layergroupAffectedTables.hasAffectedTables(dbName, layergroupId)) {
|
||||
return callback(null, this.layergroupAffectedTables.get(dbName, layergroupId));
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
step(
|
||||
function checkCached() {
|
||||
if (self.layergroupAffectedTables.hasAffectedTables(dbName, layergroupId)) {
|
||||
return callback(null, self.layergroupAffectedTables.get(dbName, layergroupId));
|
||||
}
|
||||
return null;
|
||||
},
|
||||
function extractSQL(err) {
|
||||
assert.ifError(err);
|
||||
|
||||
function extractSQL() {
|
||||
step(
|
||||
function loadFromStore() {
|
||||
self.mapStore.load(layergroupId, this);
|
||||
|
Loading…
Reference in New Issue
Block a user