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

@ -210,6 +210,9 @@ module Discourse
# Load plugins
Discourse.plugins.each(&:notify_after_initialize)
# we got to clear the pool in case plugins connect
ActiveRecord::Base.connection_handler.clear_active_connections!
# This nasty hack is required for not precompiling QUnit assets
# in test mode. see: https://github.com/rails/sprockets-rails/issues/299#issuecomment-167701012
ActiveSupport.on_load(:action_view) do