summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan A. Sternberg <jonathansternberg@gmail.com>2013-11-11 16:09:06 -0500
committerJonathan A. Sternberg <jonathansternberg@gmail.com>2013-11-20 13:50:58 -0500
commit4e15496c8f1290928a47c2428bb62b75118e0c90 (patch)
tree111eac7ddaeb9cbf50175c88ee564a606f0d9b3a
parent6fc922c23242dd3d1a222f8564c8b74b71c6aa10 (diff)
downloadgitlab-shell-4e15496c8f1290928a47c2428bb62b75118e0c90.tar.gz
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.
-rw-r--r--lib/gitlab_update.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab_update.rb b/lib/gitlab_update.rb
index 038253a..5836b2e 100644
--- a/lib/gitlab_update.rb
+++ b/lib/gitlab_update.rb
@@ -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