From 63cf4738ea05a371c252d76ab69fc6843e261d0f Mon Sep 17 00:00:00 2001 From: Kristian Garza Date: Tue, 8 Oct 2019 20:25:02 +0200 Subject: [PATCH] avoid cache when its wrong --- app/jobs/event_registrant_update_by_id_job.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/jobs/event_registrant_update_by_id_job.rb b/app/jobs/event_registrant_update_by_id_job.rb index 69ff64115..caf98344e 100644 --- a/app/jobs/event_registrant_update_by_id_job.rb +++ b/app/jobs/event_registrant_update_by_id_job.rb @@ -19,6 +19,10 @@ 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 @@ -26,6 +30,7 @@ def perform(id, options={}) 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