import schedule from "node-schedule" import report from "../controller/groupAgent/report" import { loginPbClient } from "../db/pbClient" import byteMonitor from "./byteMonitor" import fmMonitor from "./fmMonitor" import sendZhongNotify from "./zhongNotify" export const initSchedule = async () => { // 定时任务,每周一到周四晚上 8 点 0 分 0 秒执行 schedule.scheduleJob("0 20 * * 1-4", () => report.genAllReport("daily")) // 定时任务,每周五晚上 8 点 0 分 0 秒执行 schedule.scheduleJob("0 20 * * 5", () => report.genAllReport("weekly")) // 定时任务,每天早上 6 点 0 分 0 秒执行 schedule.scheduleJob("0 6 * * *", sendZhongNotify) // 定时任务,每5分钟执行一次 schedule.scheduleJob("*/5 * * * *", fmMonitor) // 定时任务,每小时执行一次 schedule.scheduleJob("0 * * * *", loginPbClient) // 定时任务,每小时执行一次 schedule.scheduleJob("0 * * * *", byteMonitor) }