enigma-bbs/core/misc_scheduled_events.js

26 lines
592 B
JavaScript
Raw Permalink Normal View History

2019-02-09 17:56:36 +00:00
/* jslint node: true */
'use strict';
const StatLog = require('./stat_log.js');
const SysProps = require('./system_property.js');
2019-02-09 17:56:36 +00:00
2019-02-10 19:31:25 +00:00
exports.dailyMaintenanceScheduledEvent = dailyMaintenanceScheduledEvent;
2019-02-09 17:56:36 +00:00
2019-02-10 19:31:25 +00:00
function dailyMaintenanceScheduledEvent(args, cb) {
2019-02-09 17:56:36 +00:00
//
// Various stats need reset daily
//
// :TODO: files/etc. here
const resetProps = [
SysProps.LoginsToday,
SysProps.MessagesToday,
SysProps.NewUsersTodayCount,
];
resetProps.forEach(prop => {
2019-02-09 17:56:36 +00:00
StatLog.setNonPersistentSystemStat(prop, 0);
});
return cb(null);
}