From 090ccdb913b92b12419f3e686dd3d7f3443f6e8d Mon Sep 17 00:00:00 2001 From: Jacopo Date: Tue, 31 Oct 2023 12:26:23 +0100 Subject: [PATCH] Fix ActiveRecord check In Rails 7.1 the database connection is no longer triggered by #new_connection, this implies that at boot time the connection is not yet active. To fix it first trigger a connection ourselves. See https://github.com/rails/rails/commit/2da1852ac9b1886407464b246da3b99cfa186cfc --- lib/easymon/checks/active_record_check.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/easymon/checks/active_record_check.rb b/lib/easymon/checks/active_record_check.rb index 723a16d..89c803f 100644 --- a/lib/easymon/checks/active_record_check.rb +++ b/lib/easymon/checks/active_record_check.rb @@ -18,6 +18,7 @@ def check private def database_up? + klass.connection.connect! klass.connection.active? rescue false