diff options
-rw-r--r-- | config.yml.example | 10 | ||||
-rw-r--r-- | lib/gitlab_net.rb | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/config.yml.example b/config.yml.example index 166e384..cd66022 100644 --- a/config.yml.example +++ b/config.yml.example @@ -38,8 +38,16 @@ redis: # port: 6379 # pass: redispass # Allows you to specify the password for Redis database: 0 - socket: /var/run/redis/redis.sock # Comment out this line if you want to use TCP + socket: /var/run/redis/redis.sock # Comment out this line if you want to use TCP or Sentinel namespace: resque:gitlab + # sentinels: + # - + # host: 127.0.0.1 + # port: 26380 + # - + # host: 127.0.0.1 + # port: 26381 + # Log file. # Default is gitlab-shell.log in the root directory. diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index c06ed1e..35a8833 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -81,6 +81,12 @@ class GitlabNet db: database } + if redis_config.has_key?('sentinels') + params[:sentinels] = redis_config['sentinels'] + .select { |s| s['host'] && s['port'] } + .map { |s| { host: s['host'], port: s['port'] } } + end + if redis_config.has_key?("socket") params = { path: redis_config['socket'], db: database } elsif redis_config.has_key?("pass") |