diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2019-08-13 18:41:25 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2019-08-13 18:41:25 +0300 |
commit | 3702ab7317533896c7455357dd6643181666f22b (patch) | |
tree | cd1a6ff66d7ac489922da4a6a38df6057f5cf172 /app/workers | |
parent | 530f7f6f0f3172d5712beb0a00c861ffa6935bd7 (diff) | |
parent | afe867921cab046a34bc463840c6e9f5d51f1f70 (diff) |
Merge branch '65803-invalidate-branches-cache-on-refresh' into 'master'
Only expire branch cache once per push
See merge request gitlab-org/gitlab-ce!31653
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/post_receive.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index dba7837bd12..d8dfbc0faf7 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -42,6 +42,9 @@ class PostReceive user = identify_user(post_received) return false unless user + # Expire the branches cache so we have updated data for this push + post_received.project.repository.expire_branches_cache if post_received.includes_branches? + post_received.enum_for(:changes_refs).with_index do |(oldrev, newrev, ref), index| service_klass = if Gitlab::Git.tag_ref?(ref) |