From a9746ee19b9ee4cafe64a0e83ecad94e49191ce0 Mon Sep 17 00:00:00 2001 From: Mircea Danila Dumitrescu Date: Fri, 29 Aug 2014 15:08:21 +0100 Subject: [PATCH] Fixing duplicate events --- lib/analytics/event.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/analytics/event.js b/lib/analytics/event.js index 5fcbb60..4c76ac1 100644 --- a/lib/analytics/event.js +++ b/lib/analytics/event.js @@ -36,6 +36,7 @@ exports.putterInit = function (db, options) { return; } eventsToSave = eventsToSave.concat(events); + events=[]; } if ((eventsToSave.length > bufferSize) || (new Date().getTime() - bufferTimestamp > 100 && eventsToSave.length > 0)) { insertedDocs = eventsToSave.splice(0, bufferSize);