Skip to content

Commit

Permalink
hotfix(agents-api): Fix resource busy 429
Browse files Browse the repository at this point in the history
Signed-off-by: Diwank Singh Tomer <[email protected]>
  • Loading branch information
creatorrr committed Oct 26, 2024
1 parent 67fe9d5 commit 73e9977
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions agents-api/agents_api/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,9 @@ def wrapper(*args: P.args, client=None, **kwargs: P.kwargs) -> pd.DataFrame:
print(query)
pprint(variables)

e = getattr(e, "__cause__", None) or e
debug and print(repr(e))

if "busy" in str(e).lower():
if "busy" in str(getattr(e, "resp", e)).lower():
raise HTTPException(
status_code=429, detail="Resource busy. Please try again later."
) from e
Expand Down

0 comments on commit 73e9977

Please sign in to comment.