diff options
| author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2016-05-16 16:20:46 +0000 |
|---|---|---|
| committer | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2016-05-16 16:20:46 +0000 |
| commit | 404d0b586cfde992e56d9888d03d88766b2949a1 (patch) | |
| tree | 43597f05afc78e4eccf0c1f4919c69820cbb7b95 /lib/gitlab_config.rb | |
| parent | f0f1bbec8ad5d5fade7c0efeee22ba9b9bc44f07 (diff) | |
| parent | e88ec0a4ac7e89f078ef8fd53fa74ec5d6a4812d (diff) | |
| download | gitlab-shell-404d0b586cfde992e56d9888d03d88766b2949a1.tar.gz | |
Merge branch 'use-redis-rb-client' into 'master'
Use Redis Ruby client instead of shelling out to redis-cli
Previously the post-receive hook fired redis-cli, but if the argument list was too long the hook would silently fail. Instead of shelling out to redis-cli, we use a Ruby client to send the same message.
Closes gitlab-org/gitlab-ce#17329
See merge request !59
Diffstat (limited to 'lib/gitlab_config.rb')
| -rw-r--r-- | lib/gitlab_config.rb | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/gitlab_config.rb b/lib/gitlab_config.rb index 831f0e3..690c40e 100644 --- a/lib/gitlab_config.rb +++ b/lib/gitlab_config.rb @@ -1,3 +1,4 @@ +$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'vendor/redis/lib'))) require 'yaml' class GitlabConfig @@ -54,26 +55,4 @@ class GitlabConfig def git_annex_enabled? @config['git_annex_enabled'] ||= false end - - # Build redis command to write update event in gitlab queue - def redis_command - if redis.empty? - # Default to old method of connecting to redis - # for users that haven't updated their configuration - %W(env -i redis-cli) - else - redis['database'] ||= 0 - redis['host'] ||= '127.0.0.1' - redis['port'] ||= '6379' - if redis.has_key?("socket") - %W(#{redis['bin']} -s #{redis['socket']} -n #{redis['database']}) - else - if redis.has_key?("pass") - %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']} -n #{redis['database']} -a #{redis['pass']}) - else - %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']} -n #{redis['database']}) - end - end - end - end end |
