Skip to content

Commit

Permalink
fix(proxy/utils.py): fix retry logic for generic data request
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishdholakia committed May 2, 2024
1 parent e26b398 commit acda064
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions litellm/proxy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ async def check_view_exists(self):
@backoff.on_exception(
backoff.expo,
Exception, # base exception to catch for the backoff
max_tries=3, # maximum number of retries
max_time=10, # maximum total time to retry for
max_tries=1, # maximum number of retries
max_time=2, # maximum total time to retry for
on_backoff=on_backoff, # specifying the function to call on backoff
)
async def get_generic_data(
Expand Down Expand Up @@ -718,7 +718,8 @@ async def get_generic_data(
import traceback

error_msg = f"LiteLLM Prisma Client Exception get_generic_data: {str(e)}"
print_verbose(error_msg)
verbose_proxy_logger.error(error_msg)
error_msg = error_msg + "\nException Type: {}".format(type(e))
error_traceback = error_msg + "\n" + traceback.format_exc()
end_time = time.time()
_duration = end_time - start_time
Expand Down

0 comments on commit acda064

Please sign in to comment.