diff --git a/libraries/redis-wrapper/index.js b/libraries/redis-wrapper/index.js index f6c600ae4a..45d0fc383c 100644 --- a/libraries/redis-wrapper/index.js +++ b/libraries/redis-wrapper/index.js @@ -26,6 +26,12 @@ function createClient(opts) { standardOpts.retry_max_delay = 5000 // ms } + if (standardOpts.endpoints) { + throw new Error( + '@overleaf/redis-wrapper: redis-sentinel is no longer supported' + ) + } + let client if (opts.cluster) { delete standardOpts.cluster diff --git a/libraries/redis-wrapper/test/unit/src/test.js b/libraries/redis-wrapper/test/unit/src/test.js index af1c3db190..12671d539b 100644 --- a/libraries/redis-wrapper/test/unit/src/test.js +++ b/libraries/redis-wrapper/test/unit/src/test.js @@ -55,6 +55,20 @@ describe('index', function () { return (this.auth_pass = '1234 pass') }) + describe('redis-sentinel', function () { + it('should throw an error when creating a client', function () { + const redisSentinelOptions = { + endpoints: ['127.0.0.1:1234', '127.0.0.1:2345', '127.0.0.1:3456'], + } + const createNewClient = () => { + this.redis.createClient(redisSentinelOptions) + } + expect(createNewClient).to.throw( + '@overleaf/redis-wrapper: redis-sentinel is no longer supported' + ) + }) + }) + describe('single node redis', function () { beforeEach(function () { return (this.standardOpts = {