fix: incorrect SQL ingetVideosNearMilestone

This commit is contained in:
alikia2x (寒寒) 2025-04-06 16:21:46 +08:00
parent dd720b18fa
commit a90747878e
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6
2 changed files with 1 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import { LatestSnapshotType } from "db/schema.d.ts";
export async function getVideosNearMilestone(client: Client) { export async function getVideosNearMilestone(client: Client) {
const queryResult = await client.queryObject<LatestSnapshotType>(` const queryResult = await client.queryObject<LatestSnapshotType>(`
SELECT ls SELECT ls.*
FROM latest_video_snapshot ls FROM latest_video_snapshot ls
WHERE WHERE
(views >= 90000 AND views < 100000) OR (views >= 90000 AND views < 100000) OR

View File

@ -153,9 +153,7 @@ export const collectMilestoneSnapshotsWorker = async (_job: Job) => {
const videos = await getVideosNearMilestone(client); const videos = await getVideosNearMilestone(client);
for (const video of videos) { for (const video of videos) {
const aid = Number(video.aid); const aid = Number(video.aid);
console.debug(aid, video.aid);
const eta = await getAdjustedShortTermETA(client, aid); const eta = await getAdjustedShortTermETA(client, aid);
logger.log(`ETA for ${aid}: ${eta}`)
if (eta > 72) continue; if (eta > 72) continue;
const now = Date.now(); const now = Date.now();
const scheduledNextSnapshotDelay = eta * HOUR; const scheduledNextSnapshotDelay = eta * HOUR;