Skip to content

Navigation Menu

Sign in
Sign up

Rq retry - #120

Open
amks1 wants to merge 2 commits into
rq:master from
amks1:rq-retry
Open

Rq retry #120
amks1 wants to merge 2 commits into
rq:master from
amks1:rq-retry

Conversation

@amks1

@amks1 amks1 commented Feb 20, 2022
edited
Loading

Copy link
Copy Markdown

Added support for the Retry() class of RQ. Tested working.

hartleybrody reacted with hooray emoji

liqb commented Oct 20, 2022

Copy link
Copy Markdown

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

mllife commented Nov 23, 2023
edited
Loading

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /