const moment = require('moment') const { refresh } = require('../utils/waterCache'); module.exports = function (app, opts) { const { models } = app.fs.dc const freshWater = app.fs.scheduleInit( { interval: '0 * * * * *', // interval: '*/3 * * * *', immediate: true, // proRun: true, }, async () => { try { const waterCache = app.fs.waterCache if (waterCache) { Object.keys(waterCache).forEach(key => { key.indexOf('login') > -1 ? app.fs.utils.getAnxinyunToken() : key.indexOf('axy/alarm') > -1 ? null : app.fs.utils.getDataFromAxy(key, 'get', {}) }) } } catch (error) { app.fs.logger.error(`sechedule: freshYingshiState, error: ${error}`) } }); return { freshWater, } }