鍍金池/ 問答/數(shù)據(jù)庫  HTML/ sequelize 鏈接資源使用完畢會自動釋放嗎?

sequelize 鏈接資源使用完畢會自動釋放嗎?

如題, sequelize 鏈接資源使用完畢會自動釋放嗎? 目前只看到一個 close方法, 但是源碼中的

注釋信息如下:

Close all connections used by this sequelize instance, and free all references so the instance can be garbage collected.

并沒有看到類似 release的方法

回答
編輯回答
糖豆豆

sequelize 資源并不會自動釋放,sequelize創(chuàng)建ControllerManager管理數(shù)據(jù)庫連接池,它在進程退出時后清理連接池,所以平時我們并不需要調(diào)用close()。

2017年6月5日 09:06