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
Add retry logic to Anidex #11318
Add retry logic to Anidex #11318
Conversation
0cfb82f
to
8e13919
Compare
There was already some retry logic there so this is making it consistent and easier to override or make user configurable.
Updated following discussion in #11221 .
I have also added some properties and methods to the protected override int NumberOfRetryAttempts => 5; Alternatively, a user-configurable setting can be added to an indexer by calling the This keeps the UI for retries consistent and reduces code duplication, however, it restricts indexers from using the Two indexers with known stability issues have had user configurable retries enabled: Anidex and RARBG (#11221). |
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.
Tested OK.
Mind you, as is usually the case for me, when I tested both RARBG and Anidex I could not get them to fail so I don't get to see the retry in action ;-D
Thanks @garfield69 ! Have a look at Mockoon (https://mockoon.com/). You may have to tweak some URLs so that the indexers point at localhost rather than the actual sites but it should let you force failure responses. Also handy for development so that you don't have to keep hitting the sites. |
Anidex seems to have been having quite a lot of issues ongoing for a few months now. The pages are returning 500 errors but if you refresh a few times the page loads. Obviously the ideal solution would be for Anidex to resolve this but not much seems to be happening there and this is causing the indexer to go offline in Sonarr.
This change adds retry logic using Polly. The retries are configured with a delay between which increases exponentially in order to reduce strain on the server. It will also log a warning message when an error response is received so that the attempts can be tracked.
The default has been set not to retry as the delay will increase the API response times.
Apologies if this isn't meeting coding standards. My VS install is broken so I'm having to use VSCode.