improved logger and added shutdown handler

This commit is contained in:
Bojan Kucera 2025-06-05 09:24:25 -04:00
parent 7c2e055dd4
commit 83e8c44d98
4 changed files with 123 additions and 2 deletions

View file

@ -1,7 +1,7 @@
/**
* Data Service - Combined live and historical data ingestion
*/
import { createLogger } from '@stock-bot/logger';
import { createLogger, GracefulShutdownManager } from '@stock-bot/logger';
import { loadEnvVariables } from '@stock-bot/config';
import { Hono } from 'hono';
import { serve } from '@hono/node-server';
@ -11,6 +11,8 @@ loadEnvVariables();
const app = new Hono();
const logger = createLogger('data-service');
const shutdownManager = new GracefulShutdownManager(logger);
const PORT = parseInt(process.env.DATA_SERVICE_PORT || '3002');
// Health check endpoint
app.get('/health', (c) => {