-
Notifications
You must be signed in to change notification settings - Fork 0
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
Expose the current attempt number to the recoverFromFailure
callback
#1
Comments
Hi @edigaryev! If I understood correctly, you are adding logging for the retries. If so, then have you considered passing a logger object to the For example, here are some example log messages when using an
|
Exactly.
I see that there are two types of loggers that the The The swift-retry/Sources/Retry/Retry.swift Lines 328 to 330 in 9edd186
Taking into account the issues above, it seems to me that passing the missing bits to the |
(Sorry for the delay. I missed your reply.)
I just released version
Hopefully with the above changes, this shouldn’t be necessary! |
@fumoboy007 thank you! I haven't tested it yet, but with the changes you've mentioned this should be possible, so closing the issue. |
This would allow the
swift-retry
package users to avoid printing extraneous information if this is the last possible retry attempt.Here's a real-world example: https://github.com/cirruslabs/tart/pull/788/files#diff-52d106b7150fe2a5d777ea88144bbf0a07f23d521a973fa1fd92133ab223fec3R196.
Here's a similar library for Golang that has this feature: https://pkg.go.dev/github.com/avast/retry-go/v4#OnRetryFunc.
P.S. thanks for making such a great package ❤️
The text was updated successfully, but these errors were encountered: