mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-30 22:46:17 +02:00
Reset daily stats @ midnight, duh
This commit is contained in:
parent
032e6d59b8
commit
6a7aa5acb8
2 changed files with 22 additions and 0 deletions
18
core/misc_scheduled_events.js
Normal file
18
core/misc_scheduled_events.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
/* jslint node: true */
|
||||
'use strict';
|
||||
|
||||
const StatLog = require('./stat_log.js');
|
||||
const SysProps = require('./system_property.js');
|
||||
|
||||
exports.resetDailyStatsScheduledEvent = resetDailyStatsScheduledEvent;
|
||||
|
||||
function resetDailyStatsScheduledEvent(args, cb) {
|
||||
//
|
||||
// Various stats need reset daily
|
||||
//
|
||||
[ SysProps.LoginsToday, SysProps.MessagesToday ].forEach(prop => {
|
||||
StatLog.setNonPersistentSystemStat(prop, 0);
|
||||
});
|
||||
|
||||
return cb(null);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue