diff options
author | DJ Mountney <david@twkie.net> | 2017-09-06 16:09:20 -0700 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2017-09-06 16:09:20 -0700 |
commit | b373c56c7b2898fc0cac16a26a41c7019ab7ca3e (patch) | |
tree | 749c8661edb7cae36cae8f4eec548206b8a5ac5d /lib/api/helpers | |
parent | ac38f36abe017dfe80a30c2e646a14c4c69c08b0 (diff) | |
parent | 21935d85382989e38dd4cc12de55966e0c9b6eba (diff) | |
download | gitlab-ce-b373c56c7b2898fc0cac16a26a41c7019ab7ca3e.tar.gz |
Merge remote-tracking branch 'origin/master' into dev-master
Diffstat (limited to 'lib/api/helpers')
-rw-r--r-- | lib/api/helpers/internal_helpers.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb index f57ff0f2632..4c0db4d42b1 100644 --- a/lib/api/helpers/internal_helpers.rb +++ b/lib/api/helpers/internal_helpers.rb @@ -46,6 +46,15 @@ module API ::MergeRequests::GetUrlsService.new(project).execute(params[:changes]) end + def redis_ping + result = Gitlab::Redis::SharedState.with { |redis| redis.ping } + + result == 'PONG' + rescue => e + Rails.logger.warn("GitLab: An unexpected error occurred in pinging to Redis: #{e}") + false + end + private def set_project |