diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2019-08-13 15:41:25 +0000 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2019-08-13 15:41:25 +0000 |
commit | 3702ab7317533896c7455357dd6643181666f22b (patch) | |
tree | cd1a6ff66d7ac489922da4a6a38df6057f5cf172 /app/models/repository.rb | |
parent | 530f7f6f0f3172d5712beb0a00c861ffa6935bd7 (diff) | |
parent | afe867921cab046a34bc463840c6e9f5d51f1f70 (diff) | |
download | gitlab-ce-3702ab7317533896c7455357dd6643181666f22b.tar.gz |
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/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index a89f573e3d6..58abfaef801 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -460,8 +460,8 @@ class Repository end # Runs code after a new branch has been created. - def after_create_branch - expire_branches_cache + def after_create_branch(expire_cache: true) + expire_branches_cache if expire_cache repository_event(:push_branch) end @@ -474,8 +474,8 @@ class Repository end # Runs code after an existing branch has been removed. - def after_remove_branch - expire_branches_cache + def after_remove_branch(expire_cache: true) + expire_branches_cache if expire_cache end def method_missing(msg, *args, &block) |