Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--nodes stopped working in newest version #81

Open
bartoszhernas opened this issue Nov 15, 2023 · 1 comment
Open

--nodes stopped working in newest version #81

bartoszhernas opened this issue Nov 15, 2023 · 1 comment

Comments

@bartoszhernas
Copy link
Contributor

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 {

@bartoszhernas
Copy link
Contributor Author

The important bit is clusterNodes = clusterNodes.split(",")

The tls fixes are for users of Redis Cluster on ScaleWay which uses TLS certificate for validating the connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant