From 82389469f602837d3376486f3cf5b05297d784c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= <barisusakli@gmail.com> Date: Fri, 22 Apr 2022 15:39:27 -0400 Subject: [PATCH] feat: make it simpler to use redis sentinels --- src/database/redis/connection.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/database/redis/connection.js b/src/database/redis/connection.js index 6b43c9ee79..a4ba757ef6 100644 --- a/src/database/redis/connection.js +++ b/src/database/redis/connection.js @@ -14,6 +14,11 @@ connection.connect = async function (options) { let cxn; if (options.cluster) { cxn = new Redis.Cluster(options.cluster, options.options); + } else if (options.sentinels) { + cxn = new Redis({ + sentinels: options.sentinels, + ...options.options, + }); } else if (redis_socket_or_host && String(redis_socket_or_host).indexOf('/') >= 0) { // If redis.host contains a path name character, use the unix dom sock connection. ie, /tmp/redis.sock cxn = new Redis({