+3
-1
app/import_worker.rb
+3
-1
app/import_worker.rb
···
51
51
loop do
52
52
@user_threads.delete_if { |t| !t.alive? }
53
53
54
-
if user = User.with_unfinished_import.where.not(id: @user_threads.map(&:user_id)).first
54
+
users = User.with_unfinished_import.where.not(id: @user_threads.map(&:user_id)).to_a
55
+
56
+
users.each do |user|
55
57
collections = user.imports.unfinished.map(&:collection)
56
58
thread = UserThread.new(user, collections, @verbose)
57
59
@user_threads << thread