This commit is contained in:
张成
2026-03-18 16:16:04 +08:00
parent 3d3b9b5dfa
commit a62018a062
8 changed files with 38 additions and 17 deletions

View File

@@ -4,9 +4,9 @@ import { execute_action_and_record } from './task_executor.js';
const cron_jobs = [];
export function start_all_cron_tasks() {
export async function start_all_cron_tasks() {
for (const task of cron_task_list) {
const job = cron.schedule(task.cron_expression, async () => {
// const job = cron.schedule(task.cron_expression, async () => {
try {
await execute_action_and_record({
action_name: task.action_name,
@@ -16,9 +16,9 @@ export function start_all_cron_tasks() {
} catch (err) {
// 失败会在 crawl_run_record 落库
}
});
// });
cron_jobs.push(job);
// cron_jobs.push(job);
}
}