fix: incorrect SQL ingetVideosNearMilestone
This commit is contained in:
parent
dd720b18fa
commit
a90747878e
@ -3,7 +3,7 @@ import { LatestSnapshotType } from "db/schema.d.ts";
|
||||
|
||||
export async function getVideosNearMilestone(client: Client) {
|
||||
const queryResult = await client.queryObject<LatestSnapshotType>(`
|
||||
SELECT ls
|
||||
SELECT ls.*
|
||||
FROM latest_video_snapshot ls
|
||||
WHERE
|
||||
(views >= 90000 AND views < 100000) OR
|
||||
|
@ -153,9 +153,7 @@ export const collectMilestoneSnapshotsWorker = async (_job: Job) => {
|
||||
const videos = await getVideosNearMilestone(client);
|
||||
for (const video of videos) {
|
||||
const aid = Number(video.aid);
|
||||
console.debug(aid, video.aid);
|
||||
const eta = await getAdjustedShortTermETA(client, aid);
|
||||
logger.log(`ETA for ${aid}: ${eta}`)
|
||||
if (eta > 72) continue;
|
||||
const now = Date.now();
|
||||
const scheduledNextSnapshotDelay = eta * HOUR;
|
||||
|
Loading…
Reference in New Issue
Block a user