feat: add fluent-ffmpeg and refactor batch process

This commit is contained in:
2025-06-04 16:06:10 +09:00
committed by Satsuki Akiba (aider)
parent 935c4aaf95
commit 95043f0ea5
4 changed files with 22 additions and 148 deletions

View File

@ -3,7 +3,7 @@ import { serve } from "@hono/node-server";
import fs from "fs";
import path from "path";
import { Database } from "bun:sqlite";
import { batchProcess } from "./scripts/fetch_and_generate";
import { batchProcess } from "./services/fetch_and_generate";
import { setInterval } from "timers";
@ -198,10 +198,19 @@ function scheduleFirstBatchProcess() {
function scheduleDailyBatchProcess() {
const now = new Date();
const nextRun = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0);
const nextRun = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate() + 1,
0,
0,
0,
);
const delay = nextRun.getTime() - now.getTime();
console.log(`Next daily batch process scheduled in ${delay / 1000 / 60} minutes`);
console.log(
`Next daily batch process scheduled in ${delay / 1000 / 60} minutes`,
);
setTimeout(async () => {
try {