-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Request Retrier - limit number of retries #1672
Comments
…rier. By adding the retryCount to the Request, the RequestRetrier protocol can use the retryCount to determine whether to continue to retry the Request.
…rier. By adding the retryCount to the Request, the RequestRetrier protocol can use the retryCount to determine whether to continue to retry the Request.
Hi @Footjy, There are all sorts of ways you could handle this. I'd start simple and write some check in your Once you get this check in place, you can slowly modify it over time to be more and more robust. If you post a link to the SO question I'd be happy to answer it there as well. I also just pushed up PR #1681 which adds a If you have other ideas, please don't hesitate to post them. This system is brand new so we don't know all the ways everyone will be using it. Cheers. 🍻 |
Hi @cnoon, Thanks for your answer! The recent pull request was exactly what I was hoping, this is the simplest way to achieve that. And I could indeed have thought about a timer to do that. Here is the SO question. I'll let you post the answer :) Cheers. |
…rier. By adding the retryCount to the Request, the RequestRetrier protocol can use the retryCount to determine whether to continue to retry the Request.
* 'master' of github.com:Alamofire/Alamofire: (26 commits) [Issue Alamofire#1672] Added Request retryCount property to support RequestRetrier. Fixed test target compiler warning by not requiring app extension APIs only. [PR Alamofire#1670] Fixed compiler issue with DownloadRequest in AF4 migration guide. SPM package file now excludes tests since current configuration is not supported. Pulled in the release notes for the 3.5.1 release into the CHANGELOG. Added docstrings and note to README about resumeData and background sessions. Add 10.12 check for tests results, as macOS results are now correct. Added missing dashes in CHANGELOG…no functional changes. [PR Alamofire#1633] Fixed sample code in the README where error was used incorrectly. [PR Alamofire#1625] Fixed Session Manager internal links in the README. [PR Alamofire#1615] Fixed compiler error in response validation sample code in README. Added release notes to the CHANGELOG and bumped the version to 4.0.1. Removed excess whitespace from some of the docstrings…no functional changes. Removed framework and test target overrides that duplicated project settings. [PR Alamofire#1612] Fixed compilation issue in response handler section of the README. Fixed up if statement formatting…no functional changes. Added test verifying download request can be resumed with resume data. [Issue Alamofire#1551] Fixed retain cycle when using Validation clsoures. Fixed alignment in Travis yaml file…no functional changes. [PR Alamofire#1520] Renamed OSX to macOS throughout the project. ...
* 'master' of github.com:Alamofire/Alamofire: (27 commits) [PR Alamofire#1721] Improve embedded framework installation instructions. [PR Alamofire#1722] Update README for proper error checking in download. [Issue Alamofire#1672] Added Request retryCount property to support RequestRetrier. Fixed test target compiler warning by not requiring app extension APIs only. [PR Alamofire#1670] Fixed compiler issue with DownloadRequest in AF4 migration guide. SPM package file now excludes tests since current configuration is not supported. Pulled in the release notes for the 3.5.1 release into the CHANGELOG. Added docstrings and note to README about resumeData and background sessions. Add 10.12 check for tests results, as macOS results are now correct. Added missing dashes in CHANGELOG…no functional changes. [PR Alamofire#1633] Fixed sample code in the README where error was used incorrectly. [PR Alamofire#1625] Fixed Session Manager internal links in the README. [PR Alamofire#1615] Fixed compiler error in response validation sample code in README. Added release notes to the CHANGELOG and bumped the version to 4.0.1. Removed excess whitespace from some of the docstrings…no functional changes. Removed framework and test target overrides that duplicated project settings. [PR Alamofire#1612] Fixed compilation issue in response handler section of the README. Fixed up if statement formatting…no functional changes. Added test verifying download request can be resumed with resume data. [Issue Alamofire#1551] Fixed retain cycle when using Validation clsoures. ...
Hi cnoon, But after getting new token it get exit in delegate, request is not continuing and I am not getting any response. So please let me know, where I am wrong. Thanks |
Hi,
I've been working with the request retrier to reauthenticate when the request fails due to an expired token.
Is there a way to limit the number of retries ? This would be needed in case of a server bug that would send the expired token error when that's not the problem. There we have an infinite loop.
There may be other cases where this is needed.
I've seen this question unanswered on SO so I guess/hope I'm not the only one needing this. If you have some alternative way of doing this, please let me know.
Thanks,
The text was updated successfully, but these errors were encountered: