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 14, 2025
1 parent 8250c18 commit 9c44d1b
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions app/models/funder_identifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,15 @@ def self.push_item(item)
end

push_items = Array.wrap(funder_identifiers).reduce([]) do |ssum, iitem|
Rails.logger.info("[Event Import Worker]: Funding references inside push_items")

funder_identifier = iitem.fetch("funderIdentifier",
nil).to_s.strip.downcase

Rails.logger.info("[Event Import Worker]: Funding references funder_identifier #{funder_identifier}")

obj_id = normalize_doi(funder_identifier)

Rails.logger.info("[Event Import Worker]: Funding references obj_id #{obj_id}")
# obj_id = normalize_doi(funder_identifier)
obj_id = "https://doi.org/10.4224/17210691"

relation_type_id = "is_funded_by"
source_id = "datacite_funder"
source_token = ENV["DATACITE_FUNDER_SOURCE_TOKEN"]

Rails.logger.info("[Event Import Worker]: Funding references funder_identifier #{funder_identifier.present?}")
Rails.logger.info("[Event Import Worker]: Funding references obj_id #{obj_id.present?}")

if funder_identifier.present? && obj_id.present?
subj = cached_datacite_response(pid)
Rails.logger.info("[Event Import Worker]: Funding references subj #{subj}")
Expand Down

0 comments on commit 9c44d1b

Please sign in to comment.