diff --git a/lib/tasks/fixity_check.rake b/lib/tasks/fixity_check.rake index fee3fdef9..46b9bd3ab 100644 --- a/lib/tasks/fixity_check.rake +++ b/lib/tasks/fixity_check.rake @@ -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 @@ -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 \ No newline at end of file +end