Skip to content

Node.js based forum software built for the modern web

fix: #9818, fix totalTime calculation

Barış Soner Uşaklıc4fc7bf9b52f
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;
};