diff --git a/app/models/event.rb b/app/models/event.rb index 23e6a5068..442878104 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -376,18 +376,18 @@ def self.update_datacite_crossref(options={}) size = (options[:size] || 1000).to_i - response = Event.query(nil, source_id: "datacite_crossref", page: { size: 1, cursor: 0 }) - logger.info "[Update] #{response.results.total} events for source datacite_crossref." + response = Event.query(nil, source_id: "datacite-crossref", page: { size: 1, cursor: 0 }) + logger.info "[Update] #{response.results.total} events for source datacite-crossref." if response.results.total > 0 # walk through results using cursor cursor = 0 while response.results.results.length > 0 do - response = Event.query(nil, source_id: "crossref", page: { size: size, cursor: cursor }) + response = Event.query(nil, source_id: "datacite-crossref", page: { size: size, cursor: cursor }) break unless response.results.results.length > 0 - logger.info "[Update] Updating #{response.results.results.length} datacite_crossref events starting with _id #{cursor + 1}." + logger.info "[Update] Updating #{response.results.results.length} datacite-crossref events starting with _id #{cursor + 1}." cursor = response.results.to_a.last[:sort].first.to_i response.results.results.each do |e|