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

fix: add a 0.1 sleep to resolve 100% cpu when redis disconnects #1940

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions python/bullmq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ async def run(self):
# This should never happen or we will have an endless loop
print("ERROR:", e)
traceback.print_exc()
raise Exception("Error in worker")
return

self.running = False
Expand Down Expand Up @@ -199,3 +200,4 @@ def extract_result(job_task):
# print error message and ignore the job
print("ERROR:", e)
traceback.print_exc()
time.sleep(0.1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a retry strategy in node version https://github.com/taskforcesh/bullmq/blob/master/src/classes/worker.ts#L862-L876 you can use it as reference