You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nodebb/src/user/jobs.js

30 lines
738 B
JavaScript

'use strict';
10 years ago
var winston = require('winston'),
cronJob = require('cron').CronJob,
10 years ago
meta = require('../meta');
module.exports = function(User) {
User.startJobs = function() {
new cronJob('0 0 17 * * *', function() {
10 years ago
winston.verbose('[user.startJobs] Digest job (daily) started.');
10 years ago
User.digest.execute('day');
}, null, true);
11 years ago
10 years ago
new cronJob('0 0 17 * * 0', function() {
10 years ago
winston.verbose('[user.startJobs] Digest job (weekly) started.');
10 years ago
User.digest.execute('week');
}, null, true);
11 years ago
10 years ago
new cronJob('0 0 17 1 * *', function() {
10 years ago
winston.verbose('[user.startJobs] Digest job (monthly) started.');
10 years ago
User.digest.execute('month');
}, null, true);
new cronJob('0 0 0 * * *', User.reset.clean, null, true);
11 years ago
};
};