FIX: ensure we have no dangling db connections on threads

This correct 10 second timeouts in dev mode, when reloader kicks in
This commit is contained in:
Sam
2017-10-30 14:24:15 +11:00
parent da72ecc3fc
commit 7ca08216bd
3 changed files with 6 additions and 1 deletions

View File

@ -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