Windshaft-cartodb/lib/cartodb/backends/stats.js

17 lines
488 B
JavaScript
Raw Normal View History

var layerStats = require('./layer-stats/factory');
function StatsBackend() {
2017-05-10 00:24:24 +08:00
}
module.exports = StatsBackend;
StatsBackend.prototype.getStats = function(mapConfig, dbConnection, callback) {
var enabledFeatures = global.environment.enabledFeatures;
var layerStatsEnabled = enabledFeatures ? enabledFeatures.layerStats: false;
if (layerStatsEnabled) {
layerStats().getStats(mapConfig, dbConnection, callback);
} else {
return callback(null, []);
}
};