mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
[misc] creating a redis client with redis-sentinel opts throws an error
This commit is contained in:
parent
bcd5abadce
commit
e34f17a352
2 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue