fix: some bugs in crawler package
This commit is contained in:
parent
5409d7cbd1
commit
9f84003544
@ -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
|
||||
`;
|
||||
|
||||
@ -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}.`,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user