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上線?