diff --git a/lib/chewy/index/import.rb b/lib/chewy/index/import.rb index 839501d34..52c846119 100644 --- a/lib/chewy/index/import.rb +++ b/lib/chewy/index/import.rb @@ -185,7 +185,7 @@ def import_parallel(objects, routine) results = ::Parallel.map_with_index(batches, routine.parallel_options) do |ids, index| progress_bar.wait_until_ready - IMPORT_WORKER.call(index, routine.options, total, progress_bar, ids, self) + IMPORT_WORKER.call(self, routine.options, total, progress_bar, ids, index) end ::ActiveRecord::Base.connection.reconnect! if defined?(::ActiveRecord::Base)