leonhard-s / auraxium

A high-level Python wrapper for the PlanetSide 2 API.
https://auraxium.readthedocs.io/
MIT License
28 stars 8 forks source link

Move MaintenanceError check inside the backoff system #26

Closed leonhard-s closed 3 years ago

leonhard-s commented 3 years ago

Since one of the recent API restarts/changes, these redirect errors are now significantly more common than before (possibly one of the endpoints the load balancer forwards requests to went bad?)

Either way, these errors now are also intermittent, so the code checking for and handling them must also be included in the auto-back off system.

This also warrants checking to see if these redirects work now, which would mean that #14 must be reopened. The new solution might be to just back off up to 5 seconds before giving up and reporting the API as unreachable.

leonhard-s commented 3 years ago

As of the recent API fixes, redirects are much more common. Unfortunately, they still redirect to daybreak's main website, so I am still disallowing any redirects to save myself those large and unnecessary payloads.

I will move the maintenance check inside the retry clause and have them trigger the back-off algorithm just like any other error; only when they persist a MaintenanceError will be raised.