Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fixity_check.rake #2554

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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