backend: terminate process on Redis connection failure during startup

This commit is contained in:
Carlos Santos 2025-07-15 14:00:27 +02:00
parent 156e63e04a
commit da26614033

View File

@ -51,6 +51,12 @@ export class RedisService extends EventEmitter {
const onError = (error: Error) => {
this.logger.error('Redis Error', error);
this.emit('redisError', error);
// If Redis connection fails during startup, terminate the process
if (!this.isConnected) {
this.logger.error('Failed to connect to Redis during startup. Terminating process...');
process.exit(1);
}
};
const onDisconnect = () => {