From a138f6d572c6b897e6ff59f6933a5924affc0830 Mon Sep 17 00:00:00 2001 From: alikia2x Date: Sun, 9 Mar 2025 22:34:23 +0800 Subject: [PATCH] add: auto-removal of jobs, aliyun-fc auto retry --- lib/mq/scheduler.ts | 10 ++++++++-- src/worker.ts | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/mq/scheduler.ts b/lib/mq/scheduler.ts index 9d8767f..00c3a4e 100644 --- a/lib/mq/scheduler.ts +++ b/lib/mq/scheduler.ts @@ -270,6 +270,12 @@ class NetScheduler { "Content-Type=application/json;x-fc-invocation-type=Sync;x-fc-log-type=None;", "--body", JSON.stringify({ url: url }), + "--retry-count", + "5", + "--read-timeout", + "30", + "--connect-timeout", + "10", "--profile", `CVSA-${region}`, ], @@ -368,8 +374,8 @@ netScheduler.addProxy("native", "native", ""); for (const region of regions) { netScheduler.addProxy(`alicloud-${region}`, "alicloud-fc", region); } -netScheduler.addTask("getVideoInfo", "bilibili", ["native"]); -netScheduler.addTask("getLatestVideos", "bilibili", ["native"]); +netScheduler.addTask("getVideoInfo", "bilibili", "all"); +netScheduler.addTask("getLatestVideos", "bilibili", "all"); netScheduler.addTask("snapshotMilestoneVideo", "bilibili", regions.map((region) => `alicloud-${region}`)); netScheduler.addTask("snapshotVideo", "bilibili", [ "alicloud-qingdao", diff --git a/src/worker.ts b/src/worker.ts index fd68339..c79e943 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -36,7 +36,7 @@ const latestVideoWorker = new Worker( break; } }, - { connection: redis, concurrency: 6, removeOnComplete: { count: 1440 } }, + { connection: redis, concurrency: 6, removeOnComplete: { count: 1440 }, removeOnFail: { count: 0 } }, ); latestVideoWorker.on("active", () => {