fumoboy007 / swift-retry Goto Github PK
View Code? Open in Web Editor NEWRetries in Swift with sensible defaults and powerful flexibility.
Home Page: https://fumoboy007.github.io/swift-retry/documentation/retry/
License: MIT License
Retries in Swift with sensible defaults and powerful flexibility.
Home Page: https://fumoboy007.github.io/swift-retry/documentation/retry/
License: MIT License
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 ❤️
When using retryAfter recovery of 3 seconds, the attempts fail to execute the specified amount of times because the retry logic is skipping attempts.
Here are the logs:
Attempt 1 of 10 failed with error of type `NSError`: `Error Domain=Repository Code=0 "(null)"`. The `recoverFromFailure` closure requested a minimum delay of 2.999796458 seconds before retrying. Will wait 6.580820862 seconds before retrying.
Attempt 5 of 10 failed with error of type `NSError`: `Error Domain=Repository Code=0 "(null)"`. The `recoverFromFailure` closure requested a minimum delay of 2.999975709 seconds before retrying. Will wait 10.97492571 seconds before retrying.
Attempt 6 of 10 failed with error of type `NSError`: `Error Domain=Repository Code=0 "(null)"`. The `recoverFromFailure` closure requested a minimum delay of 2.999974041 seconds before retrying. Will wait 16.07719764 seconds before retrying.
Attempt 8 of 10 failed with error of type `NSError`: `Error Domain=Repository Code=0 "(null)"`. The `recoverFromFailure` closure requested a minimum delay of 2.999976416 seconds before retrying. Will wait 10.288304753999999 seconds before retrying.
Attempt 9 of 10 failed with error of type `NSError`: `Error Domain=Repository Code=0 "(null)"`. The `recoverFromFailure` closure requested a minimum delay of 2.999977584 seconds before retrying. Will wait 8.53429227 seconds before retrying.
Attempt 10 failed with error of type `NSError`: `Error Domain=Repository Code=0 "(null)"`. The `recoverFromFailure` closure requested a minimum delay of 2.999975042 seconds before retrying. No remaining attempts after backing off normally to achieve the minimum delay.
You can see that it is skipping from attempt 1 all the way to attempt 5. Later attempt number 7 is also skipped.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.