-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bcb056
commit 9c19d83
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,5 +62,5 @@ | |
end | ||
|
||
every :hour, roles: [:cron_production] do | ||
rake "index_timestamp:check" | ||
rake 'index_timestamp:check' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
namespace :index_timestamp do | ||
desc "Check the timestamp for the last index update and raise an error if it has not updated today" | ||
desc 'Check the timestamp for the last index update and raise an error if it has not updated today' | ||
task check: :environment do | ||
active_manager = IndexManager.all.select { |index_manager| index_manager.solr_collection.match(/catalog-alma-production$/) } | ||
Honeybadger.notify("The index has not been updated in more than 24 hours. Please check if the incremental updates are running.") if (Time.zone.now - active_manager.updated_at).to_i > 86_400 | ||
if (Time.zone.now - active_manager.updated_at).to_i > 86_400 | ||
Honeybadger.notify('The index has not been updated in more than 24 hours. Please check if the incremental updates are running.') | ||
end | ||
end | ||
end |