From 95d179835c48d4233b49b13c385f89df1c5b777f Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Thu, 30 Aug 2018 14:52:37 +0200 Subject: [PATCH] add to logs even if no overviews tables were used. {usesOverviews:false} --- lib/cartodb/models/dataview/base.js | 15 +++++++++------ test/acceptance/dataviews/overviews.js | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/cartodb/models/dataview/base.js b/lib/cartodb/models/dataview/base.js index 22cdc23b..455461a2 100644 --- a/lib/cartodb/models/dataview/base.js +++ b/lib/cartodb/models/dataview/base.js @@ -37,13 +37,16 @@ module.exports = class BaseDataview { //Overviews logging const stats = {}; - if (flags && flags.usesOverviews) { - stats.usesOverviews = true; - if (this.getType) { - stats.dataviewType = this.getType(); - } + if (flags && flags.usesOverviews !== undefined) { + stats.usesOverviews = flags.usesOverviews; + } else { + stats.usesOverviews = false; } - + + if (this.getType) { + stats.dataviewType = this.getType(); + } + return callback(null, result, stats); }, true); // use read-only transaction }); diff --git a/test/acceptance/dataviews/overviews.js b/test/acceptance/dataviews/overviews.js index cfe5a7fc..3487a08b 100644 --- a/test/acceptance/dataviews/overviews.js +++ b/test/acceptance/dataviews/overviews.js @@ -53,7 +53,7 @@ describe('dataviews using tables without overviews', function() { return done(err); } assert.deepEqual(formula_result, { operation: 'count', result: 7313, nulls: 0, type: 'formula' }); - assert(getUsesOverviewsFromHeaders(headers) === undefined); //Overviews logging + assert(getUsesOverviewsFromHeaders(headers) === false); //Overviews logging testClient.drain(done); });