diff --git a/packages/nocodb/src/redis/pubsub-redis.ts b/packages/nocodb/src/redis/pubsub-redis.ts index 1b06f55459..1b639c3f4c 100644 --- a/packages/nocodb/src/redis/pubsub-redis.ts +++ b/packages/nocodb/src/redis/pubsub-redis.ts @@ -23,9 +23,19 @@ export class PubSubRedis { PubSubRedis.redisSubscriber = new Redis(process.env.NC_REDIS_JOB_URL); PubSubRedis.redisSubscriber.on('message', async (channel, message) => { - const [command, ...args] = message.split(':'); - const callback = PubSubRedis.callbacks[command]; - if (callback) await callback(...args); + try { + if (!message || !message.includes(':')) { + return; + } + const [command, ...args] = message.split(':'); + const callback = PubSubRedis.callbacks[command]; + + if (callback) { + await callback(...args); + } + } catch (error) { + PubSubRedis.logger.error('Error processing message', error); + } }); PubSubRedis.initialized = true;