Skip to content
Prev Previous commit
Next Next commit
Added fallback to default to localhost if the redis configuration blo…
…ck is missing in config.yml
  • Loading branch information
Chr1831 authored and Chr1831 committed Mar 29, 2013
commit 8c55d8f76c032385906a17199f53efe96e7e25cd
8 changes: 6 additions & 2 deletions lib/gitlab_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ def ssh?
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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misspelling: s/redis_commend/redis_command

end

command = "#{redis_command} '{\"class\":\"PostReceive\",\"args\":[\"#{@repo_path}\",\"#{@oldrev}\",\"#{@newrev}\",\"#{@refname}\",\"#{@key_id}\"]}' > /dev/null 2>&1"
system(command)
end
end