2019-02-09 17:56:36 +00:00
|
|
|
/* jslint node: true */
|
|
|
|
'use strict';
|
|
|
|
|
2022-06-05 20:04:25 +00:00
|
|
|
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
|
|
|
|
//
|
2022-05-07 16:48:40 +00:00
|
|
|
// :TODO: files/etc. here
|
|
|
|
const resetProps = [
|
2022-06-12 20:12:03 +00:00
|
|
|
SysProps.LoginsToday,
|
|
|
|
SysProps.MessagesToday,
|
|
|
|
SysProps.NewUsersTodayCount,
|
2022-05-07 16:48:40 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
resetProps.forEach(prop => {
|
2019-02-09 17:56:36 +00:00
|
|
|
StatLog.setNonPersistentSystemStat(prop, 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
return cb(null);
|
|
|
|
}
|