Skip to content

Commit

Permalink
Add import_one task
Browse files Browse the repository at this point in the history
This is an old task to directly import specific DOI

This is useful when dealing with older metadata that is only available in the DB and not the ES index.
  • Loading branch information
richardhallett committed Oct 9, 2020
1 parent 63bd21c commit 8732cb4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/tasks/doi.rake
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ namespace :doi do
puts Doi.loop_through_dois(options)
end

desc 'Import one DOI'
task :import_one => :environment do
if ENV['DOI'].nil?
puts "ENV['DOI'] is required"
exit
end

Doi.import_one(doi_id: ENV['DOI'])
end

desc "Trigger DOI import based on query"
task import_dois_by_query: :environment do
# Ensure we have specified a query of some kind.
Expand Down

0 comments on commit 8732cb4

Please sign in to comment.