Fix import progress not updating on certain failures (#27247)

This commit is contained in:
Claire 2023-10-02 16:20:04 +02:00 committed by GitHub
parent ee866ec0e0
commit 1e2d4975cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ class Import::RowWorker
sidekiq_retries_exhausted do |msg, _exception| sidekiq_retries_exhausted do |msg, _exception|
ActiveRecord::Base.connection_pool.with_connection do ActiveRecord::Base.connection_pool.with_connection do
# Increment the total number of processed items, and bump the state of the import if needed # Increment the total number of processed items, and bump the state of the import if needed
bulk_import_id = BulkImportRow.where(id: msg['args'][0]).pick(:id) bulk_import_id = BulkImportRow.where(id: msg['args'][0]).pick(:bulk_import_id)
BulkImport.progress!(bulk_import_id) unless bulk_import_id.nil? BulkImport.progress!(bulk_import_id) unless bulk_import_id.nil?
end end
end end