From c4fc7bf9b52f6be1efc5d290007b0a2ba6d40b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 21 Sep 2021 10:21:52 -0400 Subject: [PATCH] fix: #9818, fix totalTime calculation --- src/user/approval.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/user/approval.js b/src/user/approval.js index cdb49613b6..24e84fba64 100644 --- a/src/user/approval.js +++ b/src/user/approval.js @@ -80,8 +80,8 @@ module.exports = function (User) { template: 'registration_accepted', uid: uid, }).catch(err => winston.error(`[emailer.send] ${err.stack}`)); - const total = await db.incrObjectField('registration:queue:approval:times', 'totalTime', Math.floor((Date.now() - creation_time) / 60000)); - const counter = await db.incrObjectField('registration:queue:approval:times', 'counter', 1); + const total = await db.incrObjectFieldBy('registration:queue:approval:times', 'totalTime', Math.floor((Date.now() - creation_time) / 60000)); + const counter = await db.incrObjectField('registration:queue:approval:times', 'counter'); await db.setObjectField('registration:queue:approval:times', 'average', total / counter); return uid; };