diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-19 03:06:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-19 03:06:10 +0000 |
commit | 2c352d252d072549e77d9de71fb9efe7bae94da6 (patch) | |
tree | 5db2b4820519bd7b1e808a47c5a2d69de48cbeb2 /app | |
parent | a7706bcb567ee31c6454c4197354b3210839b564 (diff) | |
download | gitlab-ce-2c352d252d072549e77d9de71fb9efe7bae94da6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/services/import_export_clean_up_service.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/services/import_export_clean_up_service.rb b/app/services/import_export_clean_up_service.rb index 3ecb51b60d0..66ac7dac4ca 100644 --- a/app/services/import_export_clean_up_service.rb +++ b/app/services/import_export_clean_up_service.rb @@ -12,16 +12,20 @@ class ImportExportCleanUpService def execute Gitlab::Metrics.measure(:import_export_clean_up) do - clean_up_export_object_files - - break unless File.directory?(path) - - clean_up_export_files + execute_cleanup end end private + def execute_cleanup + clean_up_export_object_files + ensure + # We don't want a failure in cleaning up object storage from + # blocking us from cleaning up temporary storage. + clean_up_export_files if File.directory?(path) + end + def clean_up_export_files Gitlab::Popen.popen(%W(find #{path} -not -path #{path} -mmin +#{mmin} -delete)) end |