Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous task in worker not running #1060

Closed
Robinhoodbharadwaj opened this issue Sep 25, 2018 · 7 comments
Closed

Asynchronous task in worker not running #1060

Robinhoodbharadwaj opened this issue Sep 25, 2018 · 7 comments
Labels

Comments

@Robinhoodbharadwaj
Copy link

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

@dawiss1337
Copy link

Have you tried putting return Promise.resolve({}); at the end of the separate process file?

@Robinhoodbharadwaj
Copy link
Author

I am using done callback to successfully end the job and also in case of failing.

@alolis
Copy link
Contributor

alolis commented Oct 4, 2018

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

@OkuraSt
Copy link

OkuraSt commented Nov 13, 2018

@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
Copy link
Contributor

alolis commented Nov 13, 2018

@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.

@thangtv611
Copy link

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

@stale
Copy link

stale bot commented Jul 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 12, 2021
@stale stale bot closed this as completed Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants