From f35e74eebb0b5d833f033241e2a21b5546dfb9a1 Mon Sep 17 00:00:00 2001 From: Kristian Garza Date: Tue, 8 Oct 2019 13:57:00 +0200 Subject: [PATCH] to avoid crossref rate limitting --- app/jobs/event_registrant_update_by_id_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/event_registrant_update_by_id_job.rb b/app/jobs/event_registrant_update_by_id_job.rb index 056840d59..f05547983 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.01) # to avoid crossref rate limitting + sleep(0.03) # 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