File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,16 @@ redis:
3838 # port: 6379
3939 # pass: redispass # Allows you to specify the password for Redis
4040 database: 0
41- socket: /var/run/redis/redis.sock # Comment out this line if you want to use TCP
41+ socket: /var/run/redis/redis.sock # Comment out this line if you want to use TCP or Sentinel
4242 namespace: resque:gitlab
43+ # sentinels:
44+ # -
45+ # host: 127.0.0.1
46+ # port: 26380
47+ # -
48+ # host: 127.0.0.1
49+ # port: 26381
50+
4351
4452# Log file.
4553# Default is gitlab-shell.log in the root directory.
Original file line number Diff line number Diff line change @@ -81,6 +81,12 @@ def redis_client
8181 db : database
8282 }
8383
84+ if redis_config . has_key? ( 'sentinels' )
85+ params [ :sentinels ] = redis_config [ 'sentinels' ]
86+ . select { |s | s [ 'host' ] && s [ 'port' ] }
87+ . map { |s | { host : s [ 'host' ] , port : s [ 'port' ] } }
88+ end
89+
8490 if redis_config . has_key? ( "socket" )
8591 params = { path : redis_config [ 'socket' ] , db : database }
8692 elsif redis_config . has_key? ( "pass" )
You can’t perform that action at this time.
0 commit comments