Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions app/controllers/admin/assets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def calculate_fixity_report
end

def fixity_report
@stale_in_days = ScihistDigicoll::AssetsNeedingFixityChecks::DEFAULT_PERIOD_IN_DAYS
@fixity_report = FixityReport.new.get_latest
if @fixity_report
age_in_days_of_fixity_report = (DateTime.now() - DateTime.parse(@fixity_report[:timestamp])).floor
Expand Down
2 changes: 0 additions & 2 deletions app/models/fixity_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class FixityReport < ApplicationRecord
# Assets older than EXPECTED_FRESH_IN_DAYS should not be stale, or it's a problem.
EXPECTED_FRESH_IN_DAYS = 1

STALE_IN_DAYS = ScihistDigicoll::AssetsNeedingFixityChecks::DEFAULT_PERIOD_IN_DAYS

# We store video originals in 'video_store' and everything else in 'store'.
NOT_STORED_FILE_SQL = "(file_data ->> 'storage' NOT IN ('store', 'video_store') or file_data ->> 'storage' is NULL)"
STORED_FILE_SQL = "(file_data ->> 'storage' IN ('store','video_store'))"
Expand Down
10 changes: 5 additions & 5 deletions app/views/admin/assets/fixity_report.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

<div class="col-md alert alert-info">
<ul>
<li>We intend to schedule checks such that every file is checked at least once every <%= pluralize FixityReport::STALE_IN_DAYS, 'day' %>.</li>
<li>Fixity checks run <b>nightly</b> and will check 1/<%= FixityReport::STALE_IN_DAYS %> of our total assets (~<%= @fixity_report[:asset_count] / FixityReport::STALE_IN_DAYS %> assets) each night, choosing the assets with missing or most stale checks to run checks on.</li>
<li>We intend to schedule checks such that every file is checked at least once every <%= pluralize @stale_in_days, 'day' %>.</li>
<li>Fixity checks run <b>nightly</b> and will check 1/<%= @stale_in_days %> of our total assets (~<%= @fixity_report[:asset_count] / @stale_in_days %> assets) each night, choosing the assets with missing or most stale checks to run checks on.</li>
<li>Can only run fixity checks on assets that are <i>fully ingested</i> and have attached files.</li>
<li>For assets created within last <%= pluralize FixityReport::EXPECTED_FRESH_IN_DAYS, 'day' %>, we tolerate missing fixity checks, as they may not have run yet.</li>
</ul>
Expand Down Expand Up @@ -103,7 +103,7 @@
</tr>

<tr>
<td>Fully ingested without <em>fresh</em> (within past <%= pluralize FixityReport::STALE_IN_DAYS, 'day' %>) fixity check</td>
<td>Fully ingested without <em>fresh</em> (within past <%= pluralize @stale_in_days, 'day' %>) fixity check</td>
<td><%= number_with_delimiter(@fixity_report[:not_recent_with_no_checks_or_stale_checks]) %></td>
<% if @fixity_report[:not_recent_with_no_checks_or_stale_checks] == 0 %>
<td class="bg-success text-white">
Expand Down Expand Up @@ -165,12 +165,12 @@
</tr>

<tr>
<td>Fully ingested, checked in the past <%= FixityReport::STALE_IN_DAYS %> days</td>
<td>Fully ingested, checked in the past <%= @stale_in_days %> days</td>
<td><%= number_with_delimiter(@fixity_report[:recent_checks]) %></td>
</tr>

<tr>
<td>Fully ingested, stale checks (have not been checked for <%= FixityReport::STALE_IN_DAYS %> days, or ever)</td>
<td>Fully ingested, stale checks (have not been checked for <%= @stale_in_days %> days, or ever)</td>
<td><%= number_with_delimiter(@fixity_report[:no_checks_or_stale_checks]) %></td>
</tr>

Expand Down