Skip to content

Commit

Permalink
Better logging of arks
Browse files Browse the repository at this point in the history
  • Loading branch information
bess authored and sourcefilter committed Jun 6, 2019
1 parent 3370458 commit 0df9930
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/importers/collection_record_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def create_for(record:)
end

def update_for(existing_record:, update_record:)
info_stream << "event: collection_update_started, batch_id: #{batch_id}, #{deduplication_field}: #{update_record.respond_to?(deduplication_field) ? update_record.send(deduplication_field) : update_record}"
info_stream << "event: collection_update_started, batch_id: #{batch_id}, ark: #{update_record.ark}"

collection = existing_record
collection.attributes = attributes_for(record: update_record)
collection.recalculate_size = false
if collection.save
info_stream << "event: collection_updated, batch_id: #{batch_id}, record_id: #{collection.id}, #{deduplication_field}: #{collection.respond_to?(deduplication_field) ? collection.send(deduplication_field) : collection}"
info_stream << "event: collection_updated, batch_id: #{batch_id}, record_id: #{collection.id}, ark: #{collection.ark}"
@success_count += 1
else
collection.errors.each do |attr, msg|
Expand Down

0 comments on commit 0df9930

Please sign in to comment.