backend: terminate process on Redis connection failure during startup
This commit is contained in:
parent
156e63e04a
commit
da26614033
@ -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 = () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user