diff options
author | Stan Hu <stanhu@gmail.com> | 2016-07-08 12:32:58 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-07-12 05:42:19 -0700 |
commit | 3dc6bf2b71f995a3b6ca40ebbf9abb5c11397b8b (patch) | |
tree | 80fdf211e03d5eb265d68e62a83eb784f150174b /app/services/projects/housekeeping_service.rb | |
parent | 3ca9253444710c6a2d5ad4dca345f8d558be4f1a (diff) | |
download | gitlab-ce-3dc6bf2b71f995a3b6ca40ebbf9abb5c11397b8b.tar.gz |
Expire the branch cache after `git gc` runs
Due to a stale NFS cache, it's possible that a branch lookup fails
while `git gc` is running and causes missing branches in merge requests.
Possible workaround for #15392
Diffstat (limited to 'app/services/projects/housekeeping_service.rb')
-rw-r--r-- | app/services/projects/housekeeping_service.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/services/projects/housekeeping_service.rb b/app/services/projects/housekeeping_service.rb index 752c11d7ae6..c9ad710b7bf 100644 --- a/app/services/projects/housekeeping_service.rb +++ b/app/services/projects/housekeeping_service.rb @@ -7,8 +7,6 @@ # module Projects class HousekeepingService < BaseService - include Gitlab::ShellAdapter - LEASE_TIMEOUT = 3600 class LeaseTaken < StandardError @@ -24,7 +22,7 @@ module Projects def execute raise LeaseTaken unless try_obtain_lease - GitlabShellOneShotWorker.perform_async(:gc, @project.repository_storage_path, @project.path_with_namespace) + GitGarbageCollectWorker.perform_async(@project.id) ensure Gitlab::Metrics.measure(:reset_pushes_since_gc) do update_pushes_since_gc(0) |