Skip to content

Commit

Permalink
avoid cache when its wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Oct 8, 2019
1 parent e931fea commit 63cf473
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/jobs/event_registrant_update_by_id_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ def perform(id, options={})
when "datacite-crossref"
registrant_id = cached_get_crossref_member_id(item.obj_id) if cached_get_doi_ra(item.obj_id) == "Crossref"
logger.info registrant_id
if registrant_id == "crossref.citations"
sleep(0.50)
registrant_id = get_crossref_member_id(item.obj_id)
end

obj = item.obj.merge("registrant_id" => registrant_id) unless registrant_id.nil?
logger.info obj
item.update_attributes(obj: obj) if obj.present?
when "crossref"
registrant_id = cached_get_crossref_member_id(item.subj_id) if cached_get_doi_ra(item.subj_id) == "Crossref"
logger.info registrant_id
registrant_id = get_crossref_member_id(item.subj_id) if registrant_id == "crossref.citations" ## try without cache

subj = item.subj.merge("registrant_id" => registrant_id) unless registrant_id.nil?
logger.info subj
Expand Down

0 comments on commit 63cf473

Please sign in to comment.