zhaoyingbo d748879b4c
All checks were successful
CI Monitor MIflow / build-image (push) Successful in 47s
feat: 关闭定时任务
2024-08-09 02:24:53 +00:00

21 lines
605 B
TypeScript

import { scheduleJob } from "node-schedule"
import manageRobot from "../controllers/manageRobot"
import monitorJob from "./monitorJob"
import syncPipeLine from "./syncPipeLine"
const initSchedule = async () => {
// 每周五早上10点发送CI报告
scheduleJob("0 10 * * 5", manageRobot.sendCIReportByCron)
// 每15分钟同步一次CI数据
scheduleJob("*/15 * * * *", syncPipeLine)
// // 每30秒执行一次监控任务
scheduleJob("*30 * * * * *", monitorJob)
// 立即同步一次
syncPipeLine()
// // 立即执行一次监控任务
monitorJob()
}
export default initSchedule