nestjs / typeorm

TypeORM module for Nest framework (node.js) 🍇

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Continue startup on failed connection

ydegtyar-netsolace opened this issue · comments

I'm submitting a...


[ ] Regression
[ ] Bug report
[✔] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Nest app fails startup on failed connection. We can customize the retry delay and retry count number but after the last try connection factory will throw an unhandled error and the nest application will not be started up.

Expected behavior

Nest application continues to start up after connection error and tries to reconnect to DB every one minute or a custom amount of time. All DB independent endpoints works, DB dependent endpoints should throw 500-grade error.

What is the motivation / use case for changing the behavior?

If DB is laying down on application startup application can handle DB independent endpoints and take care of other endpoints after DB turns back on without extra efforts. The default behavior can be left as it is, and failsafe mode can be provided with some boolean options.

Please search through some of our old issues on this (this has been discussed several times in the past).