From c80b047e0ca7a0de8e0c560f1be0773fd0ebbd46 Mon Sep 17 00:00:00 2001 From: alikia2x Date: Thu, 27 Mar 2025 01:31:54 +0800 Subject: [PATCH] fix: did not release db client before quiting --- lib/mq/exec/snapshotTick.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/mq/exec/snapshotTick.ts b/lib/mq/exec/snapshotTick.ts index 14875f2..2a25265 100644 --- a/lib/mq/exec/snapshotTick.ts +++ b/lib/mq/exec/snapshotTick.ts @@ -195,10 +195,14 @@ export const takeSnapshotForVideoWorker = async (job: Job) => { const retryInterval = type === "milestone" ? 5 * SECOND : 2 * MINUTE; const exists = await snapshotScheduleExists(client, id); if (!exists) { + client.release(); return; } const status = await getBiliVideoStatus(client, aid); - if (status !== 0) return `REFUSE_WORKING_BILI_STATUS_${status}` + if (status !== 0) { + client.release(); + return `REFUSE_WORKING_BILI_STATUS_${status}`; + } try { await setSnapshotStatus(client, id, "processing"); const stat = await insertVideoSnapshot(client, aid, task);