diff options
author | James Lopez <james@jameslopez.es> | 2016-08-01 11:07:06 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-08-01 11:07:06 +0200 |
commit | 81495528f90b009bd4e649fbfd2b0ff951032fc4 (patch) | |
tree | fc71a9b9a5141fe49aadb0f49a2b50a8eddbff86 | |
parent | dad1d0b8646b75ffcb3b1f6758848c53482f6bd2 (diff) | |
download | gitlab-ce-fix/importing-io-timing-issue.tar.gz |
refactored wait_for_archived_file methodfix/importing-io-timing-issue
-rw-r--r-- | lib/gitlab/import_export/file_importer.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/gitlab/import_export/file_importer.rb b/lib/gitlab/import_export/file_importer.rb index 4b5f1f26286..eca6e5b6d51 100644 --- a/lib/gitlab/import_export/file_importer.rb +++ b/lib/gitlab/import_export/file_importer.rb @@ -30,14 +30,12 @@ module Gitlab # Exponentially sleep until I/O finishes copying the file def wait_for_archived_file MAX_RETRIES.times do |retry_number| - if File.exist?(@archive_file) - yield + break if File.exist?(@archive_file) - return true - else - sleep(2**retry_number) - end + sleep(2**retry_number) end + + yield end def decompress_archive |