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 3ae0afd commit 502bee8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/models/concerns/importable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def import_from_api
end

def parse_record(sqs_msg: nil, data: nil)
Rails.logger.info("[Event Import Worker]: Parse Record")
id = "https://doi.org/#{data['id']}"
response = get_datacite_json(id)

Expand All @@ -224,6 +223,7 @@ 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" }
Expand All @@ -236,7 +236,6 @@ def parse_record(sqs_msg: nil, data: nil)
end

if related_identifiers.any? { |r| r["relatedIdentifierType"] == "URL" }
Rails.logger.info("[Event Import Worker]: There are url related identifiers")
item = {
"id" => data["id"],
"type" => "dois",
Expand Down
1 change: 1 addition & 0 deletions app/models/related_identifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def push_data(result, _options = {})
end

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

Expand Down

0 comments on commit 502bee8

Please sign in to comment.