Skip to content

Commit

Permalink
allow import with cursor
Browse files Browse the repository at this point in the history
needed to import all missing doi metadata datacite/datacite#785
  • Loading branch information
kjgarza committed Nov 7, 2019
1 parent 7f0376d commit 643d148
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def self.update_crossref(options={})
logger = Logger.new(STDOUT)

size = (options[:size] || 1000).to_i
cursor = [(options[:cursor] || [])]
cursor = (options[:cursor] || [])

response = Event.query(nil, source_id: "crossref", page: { size: 1, cursor: [] })
logger.info "[Update] #{response.results.total} events for source crossref."
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/event.rake
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ end
namespace :crossref do
desc 'Import crossref dois for all events'
task :import_doi => :environment do
cursor = (ENV['CURSOR'] || Event.minimum(:id)).to_i
cursor = ENV['CURSOR'].to_s.split(",") || [Event.minimum(:id),Event.minimum(:id)]

Event.update_crossref(cursor: cursor)
end
Expand Down

0 comments on commit 643d148

Please sign in to comment.