Skip to content

Commit

Permalink
Fix DOI Minting
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Oct 13, 2024
1 parent 73453d1 commit 7c9e0e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/services/batch_doi_minting_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# For an individual minting, see DoiMintingService.

class BatchDoiMintingService
def self.run(batch_size, dry_run)
batch_doi_minting_service = new(batch_size, dry_run)
def self.run(dry_run)
batch_doi_minting_service = new(dry_run)
batch_doi_minting_service.run
end

def initialize(batch_size, dry_run)
@batch_size = batch_size
def initialize(dry_run)
@batch_size = 100
@dry_run = dry_run
@doi_minting_service = create_doi_minting_service
@unminted_objects = find_unminted_objects
Expand Down
2 changes: 1 addition & 1 deletion cron-worker/cron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

scheduler.cron '10 1 * * *' do
name = 'Mint Dois'
task = 'archive:mint_dois'
task = 'catalog:mint_dois'

puts "#{Time.current}: Starting task #{name}"

Expand Down
6 changes: 6 additions & 0 deletions lib/tasks/catalog.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ namespace :catalog do
validator = CatalogDbSyncValidatorService.new(env)
validator.run
end

desc "Mint DOIs for objects that don't have one"
task mint_dois: :environment do
dry_run = ENV['DRY_RUN'] ? true : false
BatchDoiMintingService.run(dry_run)
end
end

0 comments on commit 7c9e0e7

Please sign in to comment.