-
Notifications
You must be signed in to change notification settings - Fork 8
feat: auto retry certain errors #78
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
base: main
Are you sure you want to change the base?
Conversation
baa60fb to
c9cfcfd
Compare
commit: |
| return program.pipe( | ||
| Effect.tapError((e) => | ||
| Effect.logDebug("AWS Request Failed, Retrying...", { | ||
| error: e, | ||
| }), | ||
| ), | ||
| Effect.retry({ | ||
| schedule: Schedule.intersect( | ||
| Schedule.exponential("100 millis"), | ||
| Schedule.recurs(5), | ||
| ), | ||
| while: (e) => retryableErrorTags.includes(e._tag), | ||
| }), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can make this configurable or injectable as a layer with a sensible default.
| export const retryableErrorTags = [ | ||
| "InternalFailure", | ||
| "RequestExpired", | ||
| "ServiceException", | ||
| "ServiceUnavailable", | ||
| "ThrottlingException", | ||
| "TooManyRequestsException", | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this all of the errors? Can we extract them. Maybe the smithy models has information we cam use, e.g. all 5xx errors should be retried. Maybe there's other metadata.
No description provided.