zhaoyingbo 4c109a006f
All checks were successful
CI Monitor CI/CD / build-image (push) Successful in 31s
CI Monitor CI/CD / deploy (push) Successful in 35s
feat: 抽象定时任务
2024-06-28 10:15:29 +08:00

14 lines
425 B
TypeScript

import { scheduleJob } from "node-schedule";
import manageRobot from "../controllers/manageRobot";
import syncPipLine from "./syncPipLine";
const initSchedule = async () => {
// 每天十点钟发送CI报告
scheduleJob("0 10 * * *", manageRobot.sendCIReportByCron);
// 每15分钟同步一次CI数据
scheduleJob("*/15 * * * *", syncPipLine);
// 立即同步一次
syncPipLine();
}
export default initSchedule;