From 2bb0828af6ee1577893b9219874279772e4edf22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 30 Nov 2021 20:27:16 -0500 Subject: [PATCH] refactor: dont need local function --- src/analytics.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/analytics.js b/src/analytics.js index 4561e9519f..f2ed7fd0cc 100644 --- a/src/analytics.js +++ b/src/analytics.js @@ -87,14 +87,6 @@ Analytics.pageView = async function (payload) { } }; -function sortedSetIncrByBulk(data) { - if ('sortedSetIncrByBulk' in db) { - return db.sortedSetIncrByBulk(data); - } - const queue = data.map(([key, increment, value]) => db.sortedSetIncrBy(key, increment, value)); - return Promise.all(queue); -} - Analytics.writeData = async function () { const today = new Date(); const month = new Date(); @@ -157,7 +149,7 @@ Analytics.writeData = async function () { } if (incrByBulk.length) { - dbQueue.push(sortedSetIncrByBulk(incrByBulk)); + dbQueue.push(db.sortedSetIncrByBulk(incrByBulk)); } // Update list of tracked metrics