From cf308d71fda4974ac5cc7a0e1bdd8143d774f5b1 Mon Sep 17 00:00:00 2001 From: tikazyq Date: Fri, 16 May 2014 17:39:33 +0100 Subject: [PATCH] fixed disperser --- lib/analytics/aggregator.js | 2 +- lib/analytics/genericGetter.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/analytics/aggregator.js b/lib/analytics/aggregator.js index 45bb603..ef80cc0 100644 --- a/lib/analytics/aggregator.js +++ b/lib/analytics/aggregator.js @@ -470,7 +470,7 @@ exports.register = function (dbs, endpoints, options) { }; options.aggregations.forEach(function (aggregationObject) { - validateAndRunAggregation(aggregationObject, 20); + validateAndRunAggregation(aggregationObject, 1000); // aggregation refresh frequency }); }; diff --git a/lib/analytics/genericGetter.js b/lib/analytics/genericGetter.js index d9bf122..4068caf 100644 --- a/lib/analytics/genericGetter.js +++ b/lib/analytics/genericGetter.js @@ -28,7 +28,9 @@ function customQuery(collectionObj, filter, sort, limit, batchSize, streamified, if (streamified) { stream = cursor.sort({$natural: -1}).stream(); stream.on('data', function (document) { - documentHandler({id: document._id, time: document.t, data: (document.d === undefined ? document.key : document.d)}); + document.time = document.t; + document.data = (document.d === undefined ? document.key : document.d); + documentHandler(document); }); } else {