diff options
author | Robert Speicher <robert@gitlab.com> | 2016-02-26 22:07:50 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-02-26 22:07:50 +0000 |
commit | 2c6e34bc16e7d2ddea5601998a4496cc20902fe4 (patch) | |
tree | 21dbf9158d0a7fd0b536b55c1d020b7e625dd58f /app/services | |
parent | 01160fc06182de89c400af174861f6545ad6ceb8 (diff) | |
parent | a10678e7ebd527276f3f66d90676a03264c2ecda (diff) | |
download | gitlab-ce-2c6e34bc16e7d2ddea5601998a4496cc20902fe4.tar.gz |
Merge branch 'repository-caching-refactor' into 'master'
Refactor Repository Caching
Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/13515
See merge request !2936
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/git_push_service.rb | 6 | ||||
-rw-r--r-- | app/services/git_tag_push_service.rb | 2 | ||||
-rw-r--r-- | app/services/projects/destroy_service.rb | 6 |
3 files changed, 6 insertions, 8 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb index a1711d234ff..9ba200f7bde 100644 --- a/app/services/git_push_service.rb +++ b/app/services/git_push_service.rb @@ -16,13 +16,13 @@ class GitPushService < BaseService # 5. Executes the project's services # def execute - @project.repository.expire_cache(branch_name) + @project.repository.after_push_commit(branch_name) if push_remove_branch? - @project.repository.expire_has_visible_content_cache + @project.repository.after_remove_branch @push_commits = [] elsif push_to_new_branch? - @project.repository.expire_has_visible_content_cache + @project.repository.after_create_branch # Re-find the pushed commits. if is_default_branch? diff --git a/app/services/git_tag_push_service.rb b/app/services/git_tag_push_service.rb index 4144c7111d0..a62c5fc4fc4 100644 --- a/app/services/git_tag_push_service.rb +++ b/app/services/git_tag_push_service.rb @@ -2,7 +2,7 @@ class GitTagPushService attr_accessor :project, :user, :push_data def execute(project, user, oldrev, newrev, ref) - project.repository.expire_cache + project.repository.before_create_tag @project, @user = project, user @push_data = build_push_data(oldrev, newrev, ref) diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index f4dcb142850..df5054f08d7 100644 --- a/app/services/projects/destroy_service.rb +++ b/app/services/projects/destroy_service.rb @@ -76,11 +76,9 @@ module Projects end def flush_caches(project, wiki_path) - project.repository.expire_all_caches! if project.repository.exists? + project.repository.before_delete - wiki_repo = Repository.new(wiki_path, project) - - wiki_repo.expire_all_caches! if wiki_repo.exists? + Repository.new(wiki_path, project).before_delete end end end |