Move internal knowledge about expiring caches to the Repository class

parent f8d748a9
...@@ -426,6 +426,13 @@ class Repository ...@@ -426,6 +426,13 @@ class Repository
expire_branches_cache expire_branches_cache
end end
# Runs code after a repository has been synced.
def after_sync
expire_all_method_caches
expire_branch_cache
expire_content_cache
end
# Runs code after a new commit has been pushed. # Runs code after a new commit has been pushed.
def after_push_commit(branch_name) def after_push_commit(branch_name)
expire_statistics_caches expire_statistics_caches
......
...@@ -52,9 +52,7 @@ module Geo ...@@ -52,9 +52,7 @@ module Geo
end end
log('Expiring caches') log('Expiring caches')
project.repository.expire_all_method_caches project.after_sync
project.repository.expire_branch_cache
project.repository.expire_content_cache
finished_at = DateTime.now finished_at = DateTime.now
rescue Gitlab::Shell::Error => e rescue Gitlab::Shell::Error => e
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment