:triangular_ruler: Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone. ⭐️ Star to support our work!
Is your feature request related to a problem? Please describe.
Default configuration of BullMQ workers uses autorun: true and as a result the worker runs before async providers are built that establish db connections, etc.
So, any waiting to be executed job fails during startup as the server is not yet properly initialized
https://docs.bullmq.io/guide/workers
Describe the solution you'd like
Not sure what is the best practices there but I feel that framework should handle this. Http server is not listening before all the routes, hooks and providers are built so the same behavior should be regarding processing jobs from queues
Describe alternatives you've considered
Solution today is to disable autorun through defaultWorkerOptions
Manually inject workers
Is your feature request related to a problem? Please describe.
Default configuration of BullMQ workers uses
autorun: true
and as a result the worker runs before async providers are built that establish db connections, etc. So, any waiting to be executed job fails during startup as the server is not yet properly initialized https://docs.bullmq.io/guide/workersDescribe the solution you'd like
Not sure what is the best practices there but I feel that framework should handle this. Http server is not listening before all the routes, hooks and providers are built so the same behavior should be regarding processing jobs from queues
Describe alternatives you've considered
Solution today is to disable autorun through
defaultWorkerOptions
Manually inject workersand then do in
$afterInit
hookAdditional context
No response
Acceptance criteria
No response