Skip to content

Conversation

@iwarshak
Copy link

Summary

This PR implements my proposal in #296 (comment).

It introduces a new retry option:

{:delay, milliseconds, request_retry_modifier}

The request_retry_modifier is a function that is invoked before a retry. It receives the current request and returns a modified request.

Why?

Currently, Req does not re-run steps on retries. This new option provides an escape hatch for scenarios where request modification is needed on retry—for example, recomputing a time-based authentication header.

@iwarshak
Copy link
Author

iwarshak commented Jul 4, 2025

Just wanted to update that I used this branch in production for a business critical function where our 3rd party payment API has a rate limit that we hit AND each request has a time dependent authorization signature. This branch allowed me to have the jobs retry and recompute the auth header right before it retries. It worked great for us.

@wojtekmach
Copy link
Owner

Thanks for following up, this is great to hear. There is a bunch of retry related issues and PRs and I intend to do a full sweep on them eventually, apologies for the delay.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants