zhaoyingbo f5ee6f8555
All checks were successful
CI Monitor MIflow / build-image (push) Successful in 45s
feat: 修改监控Stage的方式
2024-08-08 11:04:09 +00:00

21 lines
600 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)
// 每10秒执行一次监控任务
scheduleJob("*/10 * * * * *", monitorJob)
// 立即同步一次
syncPipeLine()
// 立即执行一次监控任务
monitorJob()
}
export default initSchedule