chore: sync local workspace changes

This commit is contained in:
2026-05-07 11:03:47 +09:00
parent 2df0ba30cb
commit 82c0d8a197
217 changed files with 44873 additions and 1678 deletions

View File

@@ -2,12 +2,14 @@ import { env } from './config/env.js';
import { db } from './db/client.js';
import { createApp } from './app.js';
import { ChatService } from './services/chat-service.js';
import { clearAllChatConversationJobStates, ensureChatConversationTables } from './services/chat-room-service.js';
import { ensureChatConversationTables } from './services/chat-room-service.js';
import { shutdownNotificationProvider } from './services/notification-service.js';
import { ServerRestartReservationWorker } from './services/server-restart-reservation-service.js';
import { PlanWorker } from './workers/plan-worker.js';
const app = createApp();
const planWorker = new PlanWorker(app.log);
const serverRestartReservationWorker = new ServerRestartReservationWorker(app.log);
const chatService = new ChatService(app.log);
const startedAt = Date.now();
let shutdownPromise: Promise<void> | null = null;
@@ -16,12 +18,13 @@ app.server.on('upgrade', chatService.attachUpgradeHandler());
async function start() {
try {
await ensureChatConversationTables();
await clearAllChatConversationJobStates();
await chatService.recoverInterruptedSessions();
await app.listen({
host: '0.0.0.0',
port: env.PORT,
});
planWorker.start();
serverRestartReservationWorker.start();
} catch (error) {
app.log.error(error);
process.exit(1);
@@ -43,6 +46,7 @@ async function shutdown(signal: string) {
try {
await planWorker.stop();
await serverRestartReservationWorker.stop();
chatService.close();
await app.close();
await shutdownNotificationProvider();