Skip to content

--nodes stopped working in newest version #81

Open
@bartoszhernas

Description

@bartoszhernas

Seems like if passing list of nodes with comma delimited list of nodes, it is not working anymore except when used as ENV.

I've added this patch to make it work for my use case:

diff --git a/node_modules/taskforce-connector/dist/queue-factory.js b/node_modules/taskforce-connector/dist/queue-factory.js
index 9052c4b..4ef1623 100644
--- a/node_modules/taskforce-connector/dist/queue-factory.js
+++ b/node_modules/taskforce-connector/dist/queue-factory.js
@@ -75,6 +75,17 @@ exports.getRedisInfo = getRedisInfo;
 function getRedisClient(redisOpts, type, clusterNodes) {
     if (!redisClients[type]) {
         if (clusterNodes && clusterNodes.length) {
+            process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
+            Object.assign(redisOpts, {
+                redisOptions: {
+                    tls: {
+                        cert: Buffer.from(process.env.REDIS_CLUSTER_TLS ?? '', 'base64').toString('ascii')
+                    },
+                }
+            });
+            if (clusterNodes.constructor === String) {
+                clusterNodes = clusterNodes.split(",")
+            }
             redisClients[type] = new ioredis_1.Redis.Cluster(clusterNodes, redisOpts);
         }
         else {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions