Not respecting 0 as idle timout as suggested by AWS lambda doc
mokkabonna opened this issue · 2 comments
Sequelize uses lodash default to set default (respecting falsy if 0 set) while sequelize-pool does a simpler OR statement ||
https://github.com/sequelize/sequelize/blob/main/src/dialects/abstract/connection-manager.js#L34
https://github.com/sequelize/sequelize-pool/blob/master/src/Pool.ts#L167
The docs for using sequelize in AWS lambda https://sequelize.org/docs/v6/other-topics/aws-lambda/ context says to set it to 0, but that falls back to 30000ms since 0 is falsy.
Suggestion: use proper detection of undefined instead of simple or statement.
Hi @mokkabonna
Thanks for bringing this to my attention. I have marked this a bug. Can you submit a PR with tests?
This issue has been fixed by #50, now available as next major release sequelize-pool@8.0.0
. This is a breaking change, because change in the default configuration could have un-intended side-effects.
You should submit a PR to main repository, let the current maintainers decide if this can be safely added to stable sequelize release.