Replace cheero with puppeteer

This commit is contained in:
2025-06-08 21:34:11 +09:00
parent 080d47ab01
commit 4aa1b5c56a
6 changed files with 382 additions and 98 deletions

View File

@ -6,6 +6,7 @@ import { basicAuth } from "hono/basic-auth";
import { addNewFeedUrl, batchProcess } from "./scripts/fetch_and_generate.js";
import { batchScheduler } from "./services/batch-scheduler.js";
import { config, validateConfig } from "./services/config.js";
import { closeBrowser } from "./services/content-extractor.js";
import {
deleteFeed,
deleteEpisode,
@ -700,6 +701,19 @@ app.get("/", serveAdminIndex);
app.get("/index.html", serveAdminIndex);
app.get("*", serveAdminIndex);
// Graceful shutdown
process.on('SIGINT', async () => {
console.log('\n🛑 Received SIGINT. Graceful shutdown...');
await closeBrowser();
process.exit(0);
});
process.on('SIGTERM', async () => {
console.log('\n🛑 Received SIGTERM. Graceful shutdown...');
await closeBrowser();
process.exit(0);
});
// Start admin server
serve(
{