Don't forget to lycansubscribe

in the worker, eager load all unprocessed users

if there's an error in one import, we don't want it to block new imports from others

Changed files
+3 -1
app
+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