1
如果线程死亡或者我必须杀死一个正在使用ActiveRecord连接的线程,我如何确保ActiveRecord连接返回到池中?我不断收到这样的错误关闭死线程上的ActiveRecord连接
DEPRECATION WARNING: Database connections will not be closed automatically, please close your database connection at the end of the thread by calling
接近on your connection. For example: ActiveRecord::Base.connection.close
但如何确保这种情况发生在该意外死亡,或一个调用Thread.kill上线?