mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
schedule weekly/monthly spend reports
This commit is contained in:
parent
2cd584a3ad
commit
4a679bb640
1 changed files with 19 additions and 0 deletions
|
@ -3479,6 +3479,25 @@ async def startup_event():
|
|||
await proxy_config.add_deployment(
|
||||
prisma_client=prisma_client, proxy_logging_obj=proxy_logging_obj
|
||||
)
|
||||
|
||||
if (
|
||||
proxy_logging_obj is not None
|
||||
and proxy_logging_obj.slack_alerting_instance is not None
|
||||
):
|
||||
print("Alerting: Initializing Weekly/Monthly Spend Reports") # noqa
|
||||
### Schedule weekly/monhtly spend reports ###
|
||||
scheduler.add_job(
|
||||
proxy_logging_obj.slack_alerting_instance.send_weekly_spend_report,
|
||||
"cron",
|
||||
day_of_week="mon",
|
||||
)
|
||||
|
||||
scheduler.add_job(
|
||||
proxy_logging_obj.slack_alerting_instance.send_monthly_spend_report,
|
||||
"cron",
|
||||
day=1,
|
||||
)
|
||||
|
||||
scheduler.start()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue