1
0

fix: some bugs in crawler package

This commit is contained in:
alikia2x (寒寒) 2025-11-17 02:54:35 +08:00
parent 5409d7cbd1
commit 9f84003544
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 56209E0CCD8420C6
2 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ export async function findSnapshotBefore(
SELECT created_at, views
FROM video_snapshot
WHERE aid = ${aid}
AND created_at <= ${targetTime}::timestamptz
AND created_at <= ${targetTime.toISOString()}::timestamptz
ORDER BY created_at DESC
LIMIT 1
`;

View File

@ -34,7 +34,7 @@ export const snapshotVideoWorker = async (job: Job): Promise<void> => {
return;
}
const status = await getBiliVideoStatus(sql, aid);
const status = await getBiliVideoStatus(aid);
if (status !== 0) {
logger.warn(
`Video ${aid} has status ${status} in the database. Abort snapshoting.`,
@ -47,7 +47,7 @@ export const snapshotVideoWorker = async (job: Job): Promise<void> => {
await setSnapshotStatus(sql, id, "processing");
const stat = await insertVideoSnapshot(sql, aid, task);
if (typeof stat === "number") {
await setBiliVideoStatus(sql, aid, stat);
await setBiliVideoStatus(aid, stat);
await setSnapshotStatus(sql, id, "bili_error");
logger.warn(
`Bilibili return status ${status} when snapshoting for ${aid}.`,