Closed a1enc closed 10 months ago
Can you provide support for Redis Cluster?
If you just modify the createRedisConnection function, it seems to work normally.
I am using it by modifying the module as follows:
export interface RedisModuleOptions { config?: RedisOptions & { url?: string }; port?: number; host?: string; url?: string; nodes?: ClusterNode[]; options?: RedisOptions | ClusterOptions; }
export function createRedisConnection({ config, ...redisOptions }: RedisModuleOptions) { if (config) { if (config.url) { redisOptions.url ||= config.url; } redisOptions.options ||= { ...config }; } const { port, host, url, nodes, options } = redisOptions; if (nodes) { return new Redis.Cluster(nodes, options); } else if (url) { return new Redis(url, options); } else if (port && host) { return new Redis(port, host, options); } else if (port) { return new Redis(port, options); } else if (options) { return new Redis(options); } throw new Error('Invalid configuration'); }
Thanks
Yes, I will be working on it.
I have added support for clusters in version 2.0.0; for now, I have published it, but I am currently conducting several tests.
Thank you very much for your quick processing.
Can you provide support for Redis Cluster?
If you just modify the createRedisConnection function, it seems to work normally.
I am using it by modifying the module as follows:
Thanks