From 663695710bc9e982709f30ebdfb65b8993932741 Mon Sep 17 00:00:00 2001 From: Jonathan Feng Date: Mon, 22 May 2023 18:49:11 -0700 Subject: [PATCH] increase status_code check to >= 500 --- scaleapi/_version.py | 2 +- scaleapi/api.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scaleapi/_version.py b/scaleapi/_version.py index 89429b5..6875128 100644 --- a/scaleapi/_version.py +++ b/scaleapi/_version.py @@ -1,2 +1,2 @@ -__version__ = "2.14.0" +__version__ = "2.14.1" __package_name__ = "scaleapi" diff --git a/scaleapi/api.py b/scaleapi/api.py index 106bb6e..d2fb5de 100644 --- a/scaleapi/api.py +++ b/scaleapi/api.py @@ -152,8 +152,8 @@ def _api_request( # status=409, # redirect_location=None) if retry_history != (): - # See if the first retry was a 500 error - if retry_history[0][3] == 500: + # See if the first retry was a 500 or 503 error + if retry_history[0][3] >= 500: uuid = body["unique_id"] newUrl = f"{self.base_api_url}/tasks?unique_id={uuid}" # grab task from api