diff options
-rw-r--r-- | lib/gitlab_update.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab_update.rb b/lib/gitlab_update.rb index acb99cb..93f9c41 100644 --- a/lib/gitlab_update.rb +++ b/lib/gitlab_update.rb @@ -51,9 +51,13 @@ class GitlabUpdate end def update_redis - command = "#{@redis['bin']} -h #{@redis['host']} -p #{@redis['port']} rpush '#{@redis['namespace']}:queue:post_receive' "+ - "'{\"class\":\"PostReceive\",\"args\":[\"#{@repo_path}\",\"#{@oldrev}\",\"#{@newrev}\",\"#{@refname}\",\"#{@key_id}\"]}' > /dev/null 2>&1" + if @redis.present? + redis_command = "#{@redis['bin']} -h #{@redis['host']} -p #{@redis['port']} rpush '#{@redis['namespace']}:queue:post_receive'" + else + redis_commend = "env -i redis-cli" + end + command = "#{redis_command} '{\"class\":\"PostReceive\",\"args\":[\"#{@repo_path}\",\"#{@oldrev}\",\"#{@newrev}\",\"#{@refname}\",\"#{@key_id}\"]}' > /dev/null 2>&1" system(command) end end |