Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-03-31 16:38:23 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-04-01 19:33:16 +0300
commitd4c6a3af78c0ef8257c453980832c4d419aabb51 (patch)
tree0bb125fa5169fd1fb75b7b3a6f757b8ad1ab77be /app/services/projects/after_import_service.rb
parent8813447c6fd6a9c843433cc7dfda6a95fc4c2b58 (diff)
Force a full GC after importing a project
During a project import, it's possible that new branches are created by the importer to handle pull requests that have been created from forked projects, which would increment the `pushes_since_gc` value via `HousekeepingService.increment!` before a full garbage collection gets to run. This causes HousekeepingService to skip the full `git gc` and move to the incremental repack mode. To ensure that a garbage collection is run to pack refs and objects, explicitly execute the task. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59477
Diffstat (limited to 'app/services/projects/after_import_service.rb')
-rw-r--r--app/services/projects/after_import_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/projects/after_import_service.rb b/app/services/projects/after_import_service.rb
index bbdde4408d2..afb9048e87b 100644
--- a/app/services/projects/after_import_service.rb
+++ b/app/services/projects/after_import_service.rb
@@ -9,7 +9,7 @@ module Projects
end
def execute
- Projects::HousekeepingService.new(@project).execute do
+ Projects::HousekeepingService.new(@project, :gc).execute do
repository.delete_all_refs_except(RESERVED_REF_PREFIXES)
end
rescue Projects::HousekeepingService::LeaseTaken => e