mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-22 23:01:44 +00:00
remove the key_schema from options passed to redis
This commit is contained in:
parent
bce937f562
commit
bda88c0356
2 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,7 @@ module.exports = RedisSharelatex =
|
|||
Redis = require("ioredis")
|
||||
standardOpts = _.clone(opts)
|
||||
delete standardOpts.cluster
|
||||
delete standardOpts.key_schema
|
||||
client = new Redis.Cluster(opts.cluster, standardOpts)
|
||||
client.healthCheck = RedisSharelatex.clusterHealthCheckBuilder(client)
|
||||
RedisSharelatex._monkeyPatchIoredisExec(client)
|
||||
|
|
|
@ -73,12 +73,19 @@ describe "index", ->
|
|||
@settings =
|
||||
cluster: @cluster
|
||||
redisOptions: @extraOptions
|
||||
key_schema: {foo: (x) -> "#{x}"}
|
||||
|
||||
it "should pass the options correctly though with no options", ->
|
||||
client = @redis.createClient cluster: @cluster
|
||||
assert(client instanceof @ioredis.Cluster)
|
||||
client.config.should.deep.equal @cluster
|
||||
|
||||
it "should not pass the key_schema through to the driver", ->
|
||||
client = @redis.createClient cluster: @cluster, key_schema: "foobar"
|
||||
assert(client instanceof @ioredis.Cluster)
|
||||
client.config.should.deep.equal @cluster
|
||||
expect(client.options).to.deep.equal {retry_max_delay: 5000}
|
||||
|
||||
it "should pass the options correctly though with additional options", ->
|
||||
client = @redis.createClient @settings
|
||||
assert(client instanceof @ioredis.Cluster)
|
||||
|
|
Loading…
Reference in a new issue