Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import connectToDatabase from './src/config/db.js';
import redisService from './src/config/redis.js';

// Handle uncaught exceptions
process.on('uncaughtException', (error) => {
process.on('uncaughtException', async (error) => {
logger.error(`Uncaught Exception: ${error.message}`, { stack: error.stack });
process.exit(1);
await gracefulShutdown();
});

// Handle unhandled promise rejections
process.on('unhandledRejection', (reason, promise) => {
process.on('unhandledRejection', async (reason, promise) => {
logger.error(`Unhandled Rejection at: ${promise}, reason: ${reason}`);
process.exit(1);
await gracefulShutdown();
});

// Connect to database
Expand Down