samuelclay/NewsBlur — pull request #341 by ojiikun (2013-07-03 08:54:26+00:00)
Title: Android: API Retry Logic

With the refactored API manager, we can now implement #247 properly. This only triggers retries on very low-level failures such as connects failures, timeouts, etc. I also implemented exponential backoff logic so the NB servers won't get hammered in the event of duress. If the server returns a response with an error or throttle message in it (so long as it is a 200), calls will immediately stop. The retry count and interval were chosen after looking at some logs from failed calls and should be well suited to the top causes of failure - pool exhaustion (very fast) and radio mode switching (1-2 seconds).