[misc] creating a redis client with redis-sentinel opts throws an error

This commit is contained in:
Jakob Ackermann 2020-11-11 11:31:44 +00:00
parent bcd5abadce
commit e34f17a352
2 changed files with 20 additions and 0 deletions

View file

@ -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

View file

@ -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 = {