diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-08-13 23:43:15 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-08-13 23:43:15 +0300 |
commit | 1c3b570c117cc41f5f4838a8366c4367ef0749cb (patch) | |
tree | 3536db84ec02327fa18327b2cacf1593f4963d6b /app/models | |
parent | df35d772c655587eecbe7b3e387c8b8bc287b23c (diff) | |
parent | e658f9603c99ca6a8ef4c0292b2cdab2916fb09e (diff) |
Merge branch 'sh-only-flush-tags-once-per-push' into 'master'
Only expire tag cache once per push
See merge request gitlab-org/gitlab-ce!31641
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/repository.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 58abfaef801..9d45a12fa6e 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -418,25 +418,29 @@ class Repository end # Runs code before pushing (= creating or removing) a tag. + # + # Note that this doesn't expire the tags. You may need to call + # expire_caches_for_tags or expire_tags_cache. def before_push_tag + repository_event(:push_tag) + end + + def expire_caches_for_tags expire_statistics_caches expire_emptiness_caches expire_tags_cache - - repository_event(:push_tag) end # Runs code before removing a tag. def before_remove_tag - expire_tags_cache - expire_statistics_caches + expire_caches_for_tags repository_event(:remove_tag) end # Runs code after removing a tag. def after_remove_tag - expire_tags_cache + expire_caches_for_tags end # Runs code after the HEAD of a repository is changed. |