mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(proxy/utils.py): fix try-except for creating a view
This commit is contained in:
parent
55d59c0ec6
commit
212e59b49e
1 changed files with 3 additions and 6 deletions
|
@ -504,9 +504,8 @@ class PrismaClient:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# If an error occurs, the view does not exist, so create it
|
# If an error occurs, the view does not exist, so create it
|
||||||
value = await self.health_check()
|
value = await self.health_check()
|
||||||
if '"litellm_verificationtokenview" does not exist' in str(e):
|
await self.db.execute_raw(
|
||||||
await self.db.execute_raw(
|
"""
|
||||||
"""
|
|
||||||
CREATE VIEW "LiteLLM_VerificationTokenView" AS
|
CREATE VIEW "LiteLLM_VerificationTokenView" AS
|
||||||
SELECT
|
SELECT
|
||||||
v.*,
|
v.*,
|
||||||
|
@ -517,9 +516,7 @@ class PrismaClient:
|
||||||
FROM "LiteLLM_VerificationToken" v
|
FROM "LiteLLM_VerificationToken" v
|
||||||
LEFT JOIN "LiteLLM_TeamTable" t ON v.team_id = t.team_id;
|
LEFT JOIN "LiteLLM_TeamTable" t ON v.team_id = t.team_id;
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
raise e
|
|
||||||
|
|
||||||
return "LiteLLM_VerificationTokenView Created!"
|
return "LiteLLM_VerificationTokenView Created!"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue