From 7eff64773c6955b9ba0012ea6bd98a92ec4161bb Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 19 Jun 2018 17:58:21 +0800 Subject: [PATCH] Revert "FIX: Don't clear active connections in defer queue." This reverts commit c9feadf9ecf9ee2850074c616a3c83f46bc2a014. --- lib/scheduler/defer.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/scheduler/defer.rb b/lib/scheduler/defer.rb index 7a2e8f53cb4..f8f37090bb2 100644 --- a/lib/scheduler/defer.rb +++ b/lib/scheduler/defer.rb @@ -74,6 +74,8 @@ module Scheduler end rescue => ex Discourse.handle_job_exception(ex, message: "Processing deferred code queue") + ensure + ActiveRecord::Base.connection_handler.clear_active_connections! end end