Hi,
I have started using bull for queuing jobs.
One thing i found is that one of my queue has not been able to run a worker which handles asynchronous task.
There are mongoose queries in that worker and i am running worker as a separate process as mentioned in the docs.
Can anyone help me with this ??
Have you tried putting return Promise.resolve({}); at the end of the separate process file?
I am using done callback to successfully end the job and also in case of failing.
@Robinhoodbharadwaj, did you re-initialize your mongo connection inside the worker before trying to use mongoose models?
@alolis
@Robinhoodbharadwaj, did you re-initialize your mongo connection inside the worker before trying to use mongoose models?
This worked for me, do you know about other type of resources that should be re-initialized?
@alolis
@Robinhoodbharadwaj, did you re-initialize your mongo connection inside the worker before trying to use mongoose models?
This worked for me, do you know about other type of resources that should be re-initialized?
Since your processor executes in a child process you need to re-initialize everything that your processor requires to use.
@alolis
@Robinhoodbharadwaj, did you re-initialize your mongo connection inside the worker before trying to use mongoose models?
This worked for me, do you know about other type of resources that should be re-initialized?
Since your processor executes in a child process you need to re-initialize everything that your processor requires to use.
Sorry, do you mean starting bull will create a new process for Bull queue sir?
Most helpful comment
@Robinhoodbharadwaj, did you re-initialize your mongo connection inside the worker before trying to use mongoose models?