From e931fea89bae903c0e7e1bcaa2969075c60649bb Mon Sep 17 00:00:00 2001 From: Kristian Garza Date: Tue, 8 Oct 2019 16:27:03 +0200 Subject: [PATCH] there are more queues in production, we need to slow down the changes --- app/jobs/event_registrant_update_by_id_job.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/jobs/event_registrant_update_by_id_job.rb b/app/jobs/event_registrant_update_by_id_job.rb index f05547983..69ff64115 100644 --- a/app/jobs/event_registrant_update_by_id_job.rb +++ b/app/jobs/event_registrant_update_by_id_job.rb @@ -42,7 +42,7 @@ def get_crossref_member_id(id, options={}) # return "crossref.citations" unless doi.present? url = "https://api.crossref.org/works/#{Addressable::URI.encode(doi)}?mailto=info@datacite.org" - sleep(0.03) # to avoid crossref rate limitting + sleep(0.24) # to avoid crossref rate limitting response = Maremma.get(url, host: true) logger.info "[Crossref Response] [#{response.status}] for DOI #{doi} metadata" return "" if response.status == 404 ### for cases when DOI is not in the crossreaf api @@ -55,14 +55,14 @@ def get_crossref_member_id(id, options={}) def cached_get_doi_ra(doi) Rails.cache.fetch("ras/#{doi}") do - puts "did not find key in cache, executing block ..." + puts "#{doi} [RA] did not find key in cache, executing block ..." get_doi_ra(doi) end end def cached_get_crossref_member_id(doi) Rails.cache.fetch("members_ids/#{doi}") do - puts "did not find key in cache, executing block ..." + puts "#{doi} [Crossref Member] did not find key in cache, executing block ..." get_crossref_member_id(doi) end end