Replace cheero with puppeteer
This commit is contained in:
14
server.ts
14
server.ts
@ -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(
|
||||
{
|
||||
|
Reference in New Issue
Block a user