app.js 470 Bytes
const schedule = require('node-schedule')
const Sender = require('influx-batch-sender');
const config = require('./config/index')

require('./libs/logger')

const task = require('./task')

global.isProduction = process.env.NODE_ENV === 'production'
global.sender = new Sender(config.monitorReport) // 初始化数据上报

schedule.scheduleJob('0 */30 * * * *', () => {
  task()
  console.log('schedule.scheduleJob 0 */30 * * * *')
})

console.log(process.env.NODE_ENV)