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

@ -3,6 +3,7 @@ import { serve } from "@hono/node-server";
import { Hono } from "hono";
import { batchScheduler } from "./services/batch-scheduler.js";
import { config, validateConfig } from "./services/config.js";
import { closeBrowser } from "./services/content-extractor.js";
// Validate configuration on startup
try {
@ -572,6 +573,19 @@ app.get("*", serveIndex);
// Batch processing - now using batch scheduler
console.log("🔄 Batch scheduler initialized and ready");
// 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);
});
// サーバー起動
serve(
{