How to use database connections pool in Sequelize.js

前端 未结 3 1936
别那么骄傲
别那么骄傲 2020-12-29 22:13

I need some clarification about what the pool is and what it does. The docs say Sequelize will setup a connection pool on initialization so you should ideally only ever crea

3条回答
  •  时光说笑
    2020-12-29 22:40

    pool is draining error

    I found this thread in my search for a Sequalize error was giving my node.js app: pool is draining. I could not for the life of me figure it out. So for those who follow in my footsteps:

    The issue was that I was closing the database earlier than I thought I was, with the command sequelize.closeConnections(). For some reason, instead of an error like 'the database has been closed`, it was instead giving the obscure error 'pool is draining'.

提交回复
热议问题