diff --git a/config/schedule.rb b/config/schedule.rb index 9de6c085..3b5a64ec 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -62,5 +62,5 @@ end every :hour, roles: [:cron_production] do - rake "index_timestamp:check" + rake 'index_timestamp:check' end diff --git a/lib/tasks/index_timestamp.rake b/lib/tasks/index_timestamp.rake index 04f7e294..5ab0694d 100644 --- a/lib/tasks/index_timestamp.rake +++ b/lib/tasks/index_timestamp.rake @@ -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