Move internal knowledge about expiring caches to the Repository class

parent f8d748a9
......@@ -426,6 +426,13 @@ class Repository
expire_branches_cache
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.
def after_push_commit(branch_name)
expire_statistics_caches
......
......@@ -52,9 +52,7 @@ module Geo
end
log('Expiring caches')
project.repository.expire_all_method_caches
project.repository.expire_branch_cache
project.repository.expire_content_cache
project.after_sync
finished_at = DateTime.now
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