[fix] Ensured that ActiveRecord connections are released when threads are exited (30m)

{{err:9839}}