-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Conversation
liqb
commented
Oct 20, 2022
@amks1
It's great that you have retry added. I tried the retry branch and found that it does not support try with interval argument.
retry=Retry(max=3, interval=10)
I checked rq docs and found that --with-scheduler parameter should be used when start a worker, so I suggest you add it to worker command. Thanks.
Not working for me with redis. I added
retry=Retry(max=3, interval=[1, 1, 1]) to enqueue method
My 'on_failure' method is something like this;
on_failure=report_failure,
def report_failure(job, connection, type, value, traceback): # 'value' is the error msg. thrown by the error function logger.info("entered report_failure") logger.info(f"{job.retries_left=}") logger.info(f"{value=}") if job.retries_left: # redo logger.info("inside if") logger.info( f"{job.retries_left} retries left. Debug msg. '{value}'", extra={"clp_fields": { "chainId": job.id, "meta": job.meta, "process": "worker" }}, ) return # last try logger.info("outside if") logger.info(f"{job.args[0]['input']=}") # log final error logger.error( f"All retries failed. Error msg. '{value}'", extra={"clp_fields": { "chainId": job.id, "meta": job.meta, "process": "worker", }}, )
The code only enters the report_failure 1 time and then don't do anything after that, it is supposed to call the retry worker method automatically. This was working with python rq library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Added support for the Retry() class of RQ. Tested working.