From 76f223b6a9a16574fc2381025d2caadfaaeef194 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 18 Jun 2019 08:59:41 +0200 Subject: [PATCH] fix source_id. datacite/levriero#56 --- app/models/event.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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|