From 7de1033f53a1787f68e2374bb3ce05455c3d2298 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Tue, 30 Sep 2014 09:01:38 -0700 Subject: [PATCH] Rename noRetry -> noRefresh, also introduce a helper method that never refreshes --- tools/catalog-remote.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/catalog-remote.js b/tools/catalog-remote.js index 9df5756d4c..f9ae1df64c 100644 --- a/tools/catalog-remote.js +++ b/tools/catalog-remote.js @@ -673,7 +673,7 @@ _.extend(RemoteCatalog.prototype, { options = options || {}; var results = self.db.query(query, values); - if (results.length !== 0 || options.noRetry) + if (results.length !== 0 || options.noRefresh) return results; // XXX: This causes unnecessary refreshes @@ -684,11 +684,20 @@ _.extend(RemoteCatalog.prototype, { self.refresh(); options = _.clone(options); - options.noRetry = true; + options.noRefresh = true; return self._queryWithRetry(query, values, options); }, + + _simpleQuery: function (query, params) { + var self = this; + var rows = self.db.query(query, params); + return _.map(rows, function(entity) { + return JSON.parse(entity.content); + }); + }, + // Execute a query using the values as arguments of the query and return the result as JSON. // This code assumes that the table being queried always have a column called "content" _queryAsJSON: function (query, values, options) {