add: log for getRegularSnapshotInterval

This commit is contained in:
alikia2x (寒寒) 2025-03-26 23:04:08 +08:00
parent 7adc370ba2
commit 2c51c3c09c
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6

View File

@ -171,6 +171,7 @@ export const regularSnapshotsWorker = async (_job: Job) => {
const now = Date.now(); const now = Date.now();
const lastSnapshotedAt = latestSnapshot?.time ?? now; const lastSnapshotedAt = latestSnapshot?.time ?? now;
const interval = await getRegularSnapshotInterval(client, aid); const interval = await getRegularSnapshotInterval(client, aid);
logger.log(`Schedule regular snapshot for aid ${aid} in ${interval} hours.`, "mq")
const targetTime = truncate(lastSnapshotedAt + interval * HOUR, now + 1, now + 100000 * WEEK); const targetTime = truncate(lastSnapshotedAt + interval * HOUR, now + 1, now + 100000 * WEEK);
await scheduleSnapshot(client, aid, "normal", targetTime); await scheduleSnapshot(client, aid, "normal", targetTime);
if (now - startedAt > 25 * MINUTE) { if (now - startedAt > 25 * MINUTE) {
@ -207,6 +208,7 @@ export const takeSnapshotForVideoWorker = async (job: Job) => {
await setSnapshotStatus(client, id, "completed"); await setSnapshotStatus(client, id, "completed");
if (type === "normal") { if (type === "normal") {
const interval = await getRegularSnapshotInterval(client, aid); const interval = await getRegularSnapshotInterval(client, aid);
logger.log(`Schedule regular snapshot for aid ${aid} in ${interval} hours.`, "mq")
await scheduleSnapshot(client, aid, type, Date.now() + interval * HOUR); await scheduleSnapshot(client, aid, type, Date.now() + interval * HOUR);
return `DONE`; return `DONE`;
} else if (type === "new") { } else if (type === "new") {