Skip to content

Commit

Permalink
add logging for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
wendelfabianchinsamy committed Jan 13, 2025
1 parent 502bee8 commit 7d4aac3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 0 additions & 3 deletions app/models/concerns/importable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ def parse_record(sqs_msg: nil, data: nil)
["DOI", "URL"].include?(r["relatedIdentifierType"])
end

Rails.logger.info("importable the response is: #{response.inspect}")
Rails.logger.info(related_identifiers.inspect)

if related_identifiers.any? { |r| r["relatedIdentifierType"] == "DOI" }
item = {
"id" => data["id"],
Expand Down
4 changes: 3 additions & 1 deletion app/models/related_identifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def push_data(result, _options = {})
end

def self.push_item(item)
Rails.logger.info("Related Identifier: push_item")
Rails.logger.info("Related Identifier: push_item start")
attributes = item.fetch("attributes", {})
Rails.logger.info("Related Identifier: attributes -> #{attributes.inspect}")
doi = attributes.fetch("doi", nil)
Rails.logger.info("Related Identifier: doi -> #{doi.inspect}")

if doi.blank?
Rails.logger.info("[Related Identifier: doi is blank]")
Expand Down

0 comments on commit 7d4aac3

Please sign in to comment.