DEV: Try fixing flaky spec related to Scheduler::Defer

Checking if a connection is available is probably not enough, when the
connection is available, we should still verify it’s not stale.
This commit is contained in:
Loïc Guitaut 2024-11-28 15:13:19 +01:00 committed by Loïc Guitaut
parent 8f8d88afac
commit 88f1b3b195
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ module Scheduler
rescue => ex
Discourse.handle_job_exception(ex, message: "Processing deferred code queue")
ensure
if ActiveRecord::Base.connection
if ActiveRecord::Base.connection&.verify!
ActiveRecord::Base.connection_handler.clear_active_connections!
end
if start