summaryrefslogtreecommitdiff
path: root/lib/gitlab/checks/project_moved.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-04 23:38:13 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-01-04 23:38:13 +0100
commit9c9f7dc639768a0d6b930ec11c050a1333df934e (patch)
tree7a54287bb3e8eec9a57223bdace347de72beb936 /lib/gitlab/checks/project_moved.rb
parent6fb4a533b74c861a1e533604da462efb6d309de0 (diff)
parent6f1b4dc76b4619f538b7216ad3a10ca9336d0c2b (diff)
downloadgitlab-ce-9c9f7dc639768a0d6b930ec11c050a1333df934e.tar.gz
Merge branch 'master' into 41249-clearing-the-cache
Diffstat (limited to 'lib/gitlab/checks/project_moved.rb')
-rw-r--r--lib/gitlab/checks/project_moved.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/checks/project_moved.rb b/lib/gitlab/checks/project_moved.rb
index 3a1c0a3455e..dfb2f4d4054 100644
--- a/lib/gitlab/checks/project_moved.rb
+++ b/lib/gitlab/checks/project_moved.rb
@@ -21,6 +21,10 @@ module Gitlab
end
def add_redirect_message
+ # Don't bother with sending a redirect message for anonymous clones
+ # because they never see it via the `/internal/post_receive` endpoint
+ return unless user.present? && project.present?
+
Gitlab::Redis::SharedState.with do |redis|
key = self.class.redirect_message_key(user.id, project.id)
redis.setex(key, 5.minutes, redirect_message)