You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
617 B
25 lines
617 B
const schedule = require('node-schedule');
|
|
const moment = require('moment')
|
|
|
|
module.exports = function (app, opts) {
|
|
const freshYingshiState = schedule.scheduleJob(
|
|
'* * 4 * * *',
|
|
// '* */1 * * * *',
|
|
async () => {
|
|
try {
|
|
const { models } = app.fs.dc
|
|
await models.UserToken.destroy({
|
|
where: {
|
|
expired: { $lt: now }
|
|
}
|
|
})
|
|
|
|
} catch (error) {
|
|
app.fs.logger.error(`sechedule: freshYingshiState, error: ${error}`);
|
|
}
|
|
});
|
|
|
|
return {
|
|
freshYingshiState
|
|
}
|
|
}
|