From 767e19b42530fa41a4437aa2eabc35c3caadbb9b Mon Sep 17 00:00:00 2001 From: alikia2x Date: Thu, 27 Mar 2025 03:15:35 +0800 Subject: [PATCH] fix: bigint serialization failed --- lib/mq/exec/snapshotTick.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/mq/exec/snapshotTick.ts b/lib/mq/exec/snapshotTick.ts index 3f1203b..ec6ab7d 100644 --- a/lib/mq/exec/snapshotTick.ts +++ b/lib/mq/exec/snapshotTick.ts @@ -47,20 +47,21 @@ export const snapshotTickWorker = async (_job: Job) => { const groups = Math.ceil(count / 30); for (let i = 0; i < groups; i++) { const group = schedules.slice(i * 30, (i + 1) * 30); - const aids = group.map((schedule) => schedule.aid); + const aids = group.map((schedule) => Number(schedule.aid)); const filteredAids = await bulkGetVideosWithoutProcessingSchedules(client, aids); if (filteredAids.length === 0) continue; await bulkSetSnapshotStatus(client, filteredAids, "processing"); const dataMap: { [key: number]: number } = {}; for (const schedule of group) { - dataMap[schedule.id] = schedule.aid; + const id = Number(schedule.id); + dataMap[id] = Number(schedule.aid); } await SnapshotQueue.add("bulkSnapshotVideo", { map: dataMap, }, { priority: 3 }); } for (const schedule of schedules) { - if (await videoHasProcessingSchedule(client, schedule.aid)) { + if (await videoHasProcessingSchedule(client, Number(schedule.aid))) { return `ALREADY_PROCESSING`; } let priority = 3;