Skip to content

Commit

Permalink
to avoid crossref rate limitting
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Oct 8, 2019
1 parent b8857a3 commit f35e74e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/jobs/event_registrant_update_by_id_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)}[email protected]"
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
Expand Down

0 comments on commit f35e74e

Please sign in to comment.