Skip to content

Commit

Permalink
Add more logging to SubmitCollection job
Browse files Browse the repository at this point in the history
Co-authored-by: Christina Chortaria <[email protected]>
Co-authored-by: Mark Zelesky <[email protected]>
Co-authored-by: Max Kadel <[email protected]>
  • Loading branch information
4 people committed Mar 13, 2024
1 parent 067d2a1 commit 042d248
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/alma_submit_collection/marc_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def record_fixes
end

def constituent_records
Rails.logger.debug("SubmitCollection: Looking for constituent records for record #{@record['001']}")
marc_records_from_api = AlmaApi.new.fetch_marc_records(constituent_record_ids(@record))
marc_records_from_api.map do |record|
recap_record = MarcRecord.new(record, @wanted852, @wanted876, @associated_holding_fields)
Expand Down
1 change: 1 addition & 0 deletions app/models/alma_submit_collection/marc_s3_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def done
compressor = Zlib::GzipWriter.new(compressed)
compressor.write file_contents.read
compressor.close
Rails.logger.debug('SubmitCollection: Writing file to SCSB S3')
client.put_object(bucket:, body: compressed.string, key: "#{Rails.configuration.scsb_s3[:scsb_s3_updates]}/scsb_#{File.basename(file_path)}")
end
@current_file.unlink
Expand Down
1 change: 1 addition & 0 deletions app/models/marc_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def initialize(document)
end

def write(io)
Rails.logger.debug('Parsing an XML file and adding the namespace')
parser = Nokogiri::XML::SAX::Parser.new(MarcCollectionDocumentCallbacks.new(io))
io.write "<?xml version=\"1.0\"?>\n"
parser.parse document
Expand Down

0 comments on commit 042d248

Please sign in to comment.