mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-04-30 11:55:06 -04:00
fix(client): check for should retry header (#606)
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
@@ -313,10 +313,11 @@ class BaseClient(t.Generic[InnerClient, StreamType]):
|
||||
|
||||
def _should_retry(self, response: httpx.Response) -> bool:
|
||||
should_retry_header = response.headers.get('x-should-retry')
|
||||
if should_retry_header.lower() == 'true':
|
||||
return True
|
||||
if should_retry_header.lower() == 'false':
|
||||
return False
|
||||
if should_retry_header:
|
||||
if should_retry_header.lower() == 'true':
|
||||
return True
|
||||
if should_retry_header.lower() == 'false':
|
||||
return False
|
||||
if response.status_code in {408, 409, 429}:
|
||||
return True
|
||||
if response.status_code >= 500:
|
||||
|
||||
Reference in New Issue
Block a user