Skip to content

Commit

Permalink
Merge pull request #2554 from osulp/FixityCheckUsingSolrQuery
Browse files Browse the repository at this point in the history
Update fixity_check.rake
  • Loading branch information
CGillen authored Jan 10, 2024
2 parents 38b44f7 + 4574a93 commit 2f45ccb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/tasks/fixity_check.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ namespace :scholars_archive do
start_time = Time.now

# OVERRIDE: From Hyrax, add async option for Fixity check
::FileSet.find_each do |file_set|
Hyrax::FileSetFixityCheckService.new(file_set, async_jobs: false).fixity_check
s = ActiveFedora::SolrService.query("has_model_ssim:FileSet", fl: 'id', :rows => 200_000)
s.map(&:id).each do |id|
begin
file_set = ::FileSet.find(id)
Hyrax::FileSetFixityCheckService.new(file_set, async_jobs: false).fixity_check
rescue ActiveFedora::ModelMismatch
failed_arr << id
next
end
end

# CREATE: Make an end time to know when Fixity finish
Expand Down Expand Up @@ -63,4 +70,4 @@ namespace :scholars_archive do
# DELIVER: Delivering the email
ScholarsArchive::FixityMailer.with(to: user_email, data: fixity_data).report_email.deliver_now
end
end
end

0 comments on commit 2f45ccb

Please sign in to comment.