Commit 4e15496c authored by Jonathan A. Sternberg's avatar Jonathan A. Sternberg

Display error and send failure exit status if redis-cli fails

This should help prevent a misconfigured redis causing silent failures
and fix issue #108.
parent 6fc922c2
......@@ -56,6 +56,9 @@ class GitlabUpdate
def update_redis
queue = "#{config.redis_namespace}:queue:post_receive"
msg = JSON.dump({'class' => 'PostReceive', 'args' => [@repo_path, @oldrev, @newrev, @refname, @key_id]})
system(*config.redis_command, 'rpush', queue, msg, err: '/dev/null', out: '/dev/null')
unless system(*config.redis_command, 'rpush', queue, msg, err: '/dev/null', out: '/dev/null')
puts "GitLab: An unexpected error occurred (redis-cli returned #{$?.exitstatus}). "
exit 1
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment