From 421d3487e9697da40da984caede96bdec3321555 Mon Sep 17 00:00:00 2001 From: "Brandon R. Straley" Date: Tue, 9 Jan 2024 12:08:13 -0800 Subject: [PATCH 1/2] Update fixity_check.rake Updates to bypass using find_each so we dont run into Mismatch issues --- lib/tasks/fixity_check.rake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/tasks/fixity_check.rake b/lib/tasks/fixity_check.rake index fee3fdef9..a7d8494f5 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", :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 From 4574a93a36a81e25dfd3f8c4ee6395aed0e2df88 Mon Sep 17 00:00:00 2001 From: "Brandon R. Straley" Date: Wed, 10 Jan 2024 06:55:35 -0800 Subject: [PATCH 2/2] Update fixity_check.rake Request only ids --- lib/tasks/fixity_check.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/fixity_check.rake b/lib/tasks/fixity_check.rake index a7d8494f5..46b9bd3ab 100644 --- a/lib/tasks/fixity_check.rake +++ b/lib/tasks/fixity_check.rake @@ -13,7 +13,7 @@ namespace :scholars_archive do start_time = Time.now # OVERRIDE: From Hyrax, add async option for Fixity check - s = ActiveFedora::SolrService.query("has_model_ssim:FileSet", :rows => 200_000) + 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)