-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Problem
# config/allgood.rb
Database.find_each do |database|
check "#{database.name} has a daily DB backup" do
expect(database.last_backup_finished_at).to_be_greater_than(1.day.ago)
end
endbreaks the db setup (using bundle exec rails db:create), since there is no access to the DB at this point. I fixed it with a rescue block for the moment:
# config/allgood.rb
begin
if Database.table_exists?
Database.enabled.order(name: :asc).find_each do |database|
check "#{database.name} has a daily DB backup" do
expect(database.last_backup_finished_at).to_be_greater_than(1.day.ago)
end
end
end
rescue ActiveRecord::NoDatabaseError, ActiveRecord::ConnectionNotEstablished
# Skip checks during setup
endDo you have an idea how I could improve this?
Ideas
- maybe https://github.com/rameerez/allgood/blob/main/lib/allgood/engine.rb#L5 is too early for some checks?
Metadata
Metadata
Assignees
Labels
No labels