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 } }