fix: snapshot process early returned incorrectly

This commit is contained in:
alikia2x (寒寒) 2025-03-25 21:29:47 +08:00
parent 86337e3802
commit b33fd790d1
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6

View File

@ -10,7 +10,6 @@ import {
scheduleSnapshot, scheduleSnapshot,
setSnapshotStatus, setSnapshotStatus,
snapshotScheduleExists, snapshotScheduleExists,
videoHasProcessingSchedule,
} from "lib/db/snapshotSchedule.ts"; } from "lib/db/snapshotSchedule.ts";
import { Client } from "https://deno.land/x/postgres@v0.19.3/mod.ts"; import { Client } from "https://deno.land/x/postgres@v0.19.3/mod.ts";
import { HOUR, MINUTE, SECOND, WEEK } from "$std/datetime/constants.ts"; import { HOUR, MINUTE, SECOND, WEEK } from "$std/datetime/constants.ts";
@ -193,10 +192,6 @@ export const takeSnapshotForVideoWorker = async (job: Job) => {
return; return;
} }
try { try {
if (await videoHasProcessingSchedule(client, aid)) {
return `ALREADY_PROCESSING`;
}
await setSnapshotStatus(client, id, "processing");
const stat = await insertVideoSnapshot(client, aid, task); const stat = await insertVideoSnapshot(client, aid, task);
if (typeof stat === "number") { if (typeof stat === "number") {
await setBiliVideoStatus(client, aid, stat); await setBiliVideoStatus(client, aid, stat);