mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(fix) run prisma_setup on startup event
This commit is contained in:
parent
4b3e9c6b38
commit
70426cad76
1 changed files with 3 additions and 3 deletions
|
@ -341,9 +341,6 @@ def prisma_setup(database_url: Optional[str]):
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
verbose_proxy_logger.debug(
|
|
||||||
f"Error when initializing prisma, Ensure you run pip install prisma {str(e)}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def load_from_azure_key_vault(use_azure_key_vault: bool = False):
|
def load_from_azure_key_vault(use_azure_key_vault: bool = False):
|
||||||
|
@ -1209,6 +1206,9 @@ async def startup_event():
|
||||||
### LOAD MASTER KEY ###
|
### LOAD MASTER KEY ###
|
||||||
# check if master key set in environment - load from there
|
# check if master key set in environment - load from there
|
||||||
master_key = litellm.get_secret("LITELLM_MASTER_KEY", None)
|
master_key = litellm.get_secret("LITELLM_MASTER_KEY", None)
|
||||||
|
# check if DATABASE_URL in environment - load from there
|
||||||
|
if prisma_client is None:
|
||||||
|
prisma_setup(database_url=os.getenv("DATABASE_URL"))
|
||||||
|
|
||||||
### LOAD CONFIG ###
|
### LOAD CONFIG ###
|
||||||
worker_config = litellm.get_secret("WORKER_CONFIG")
|
worker_config = litellm.get_secret("WORKER_CONFIG")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue