Bull: Asynchronous task in worker not running

Created on 25 Sep 2018  路  6Comments  路  Source: OptimalBits/bull

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 ??

Most helpful comment

@Robinhoodbharadwaj, did you re-initialize your mongo connection inside the worker before trying to use mongoose models?

All 6 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joe-at-startupmedia picture joe-at-startupmedia  路  3Comments

sarneeh picture sarneeh  路  3Comments

davedbase picture davedbase  路  3Comments

thelinuxlich picture thelinuxlich  路  3Comments

weeco picture weeco  路  3Comments