diff options
author | Toon Claes <toon@gitlab.com> | 2018-11-21 22:46:50 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2018-11-28 00:48:55 +0300 |
commit | 4908e4b3a213fbdea0a45b3cc30774981529b483 (patch) | |
tree | 7c359dd0e405787b81ee5325d2cfd8ea5767fe36 /lib/gitlab/background_migration | |
parent | 220208c051ef8a23c801662beeee6b60d00b4b18 (diff) |
Run repository cleanup on failure
Diffstat (limited to 'lib/gitlab/background_migration')
-rw-r--r-- | lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config.rb b/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config.rb index a3b5324cc1d..36eff3078aa 100644 --- a/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config.rb +++ b/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config.rb @@ -106,6 +106,10 @@ module Gitlab repository_service.delete_config([FULLPATH_CONFIG_KEY]) end + def cleanup_repository + repository_service.cleanup + end + def storage @storage ||= if hashed_storage? @@ -138,7 +142,10 @@ module Gitlab def perform(project_id, retry_count) project = Project.find(project_id) - migration_class.new.safe_perform_one(project, retry_count) if project + return unless project + + project.cleanup_repository + migration_class.new.safe_perform_one(project, retry_count) end end |