mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix(proxy_cli.py): ensure proxy always retries if db push fails to connect to db
This commit is contained in:
parent
7a80df83b2
commit
3bdfb2bc6d
1 changed files with 15 additions and 13 deletions
|
@ -405,6 +405,7 @@ def run_server(
|
|||
is_prisma_runnable = False
|
||||
|
||||
if is_prisma_runnable:
|
||||
for _ in range(4):
|
||||
# run prisma db push, before starting server
|
||||
# Save the current working directory
|
||||
original_dir = os.getcwd()
|
||||
|
@ -413,9 +414,10 @@ def run_server(
|
|||
dname = os.path.dirname(abspath)
|
||||
os.chdir(dname)
|
||||
try:
|
||||
subprocess.run(
|
||||
["prisma", "db", "push", "--accept-data-loss"]
|
||||
) # this looks like a weird edge case when prisma just wont start on render. we need to have the --accept-data-loss
|
||||
subprocess.run(["prisma", "db", "push", "--accept-data-loss"])
|
||||
break # Exit the loop if the subprocess succeeds
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error: {e}")
|
||||
finally:
|
||||
os.chdir(original_dir)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue