diff --git a/Src/xWorks/WebonaryClient.cs b/Src/xWorks/WebonaryClient.cs index fd8dc21b67..f42fac62fd 100644 --- a/Src/xWorks/WebonaryClient.cs +++ b/Src/xWorks/WebonaryClient.cs @@ -113,9 +113,10 @@ private string PostToWebonaryApi(string address, string postBody, string extraAr var statusCode = ((HttpWebResponse)ex.Response).StatusCode; - // Only retry on 504 Gateway Timeout or 503 Service Unavailable + // Only retry on 504 Gateway Timeout or 503 Service Unavailable or 502 Bad Gateway (common for server overload) if ((statusCode == HttpStatusCode.GatewayTimeout || - statusCode == HttpStatusCode.ServiceUnavailable) && attempt < maxRetries) + statusCode == HttpStatusCode.ServiceUnavailable || + statusCode == HttpStatusCode.BadGateway) && attempt < maxRetries) { Thread.Sleep(retryDelay); retryDelay *= 2; // Exponential backoff