summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-07-08 11:00:30 +0200
committerJames Lopez <james@jameslopez.es>2016-07-08 11:00:30 +0200
commit2c6fe72265d250e47c03f27dc274b59d3e7e93f5 (patch)
treef02fbc031c5f762b8935538ee8ead2c523fb1924
parent6d09e946d22727ce595aeb382685292a1ad8f5a8 (diff)
downloadgitlab-ce-2c6fe72265d250e47c03f27dc274b59d3e7e93f5.tar.gz
fix thread join issuefix/import-url-migration
-rw-r--r--db/migrate/20160620110927_fix_no_validatable_import_url.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/db/migrate/20160620110927_fix_no_validatable_import_url.rb b/db/migrate/20160620110927_fix_no_validatable_import_url.rb
index 02ff1962e3f..a3f5073d511 100644
--- a/db/migrate/20160620110927_fix_no_validatable_import_url.rb
+++ b/db/migrate/20160620110927_fix_no_validatable_import_url.rb
@@ -68,7 +68,6 @@ class FixNoValidatableImportUrl < ActiveRecord::Migration
end
def process_invalid_import_urls
- @threads = []
batches = SqlBatches.new(query: "SELECT id, import_url FROM projects WHERE import_url IS NOT NULL")
while batches.next?
@@ -81,17 +80,16 @@ class FixNoValidatableImportUrl < ActiveRecord::Migration
process_batch(project_ids)
end
- @threads.each(&:join)
end
def process_batch(project_ids)
- @threads << Thread.new do
+ Thread.new do
begin
project_ids.each { |project_id| cleanup_import_url(project_id) }
ensure
ActiveRecord::Base.connection.close
end
- end
+ end.join
end
def valid_url?(url)