mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #9818, fix totalTime calculation
This commit is contained in:
@@ -80,8 +80,8 @@ module.exports = function (User) {
|
|||||||
template: 'registration_accepted',
|
template: 'registration_accepted',
|
||||||
uid: uid,
|
uid: uid,
|
||||||
}).catch(err => winston.error(`[emailer.send] ${err.stack}`));
|
}).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 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', 1);
|
const counter = await db.incrObjectField('registration:queue:approval:times', 'counter');
|
||||||
await db.setObjectField('registration:queue:approval:times', 'average', total / counter);
|
await db.setObjectField('registration:queue:approval:times', 'average', total / counter);
|
||||||
return uid;
|
return uid;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user