fix(slack_alerting.py): fix timezone utc issue

This commit is contained in:
Krrish Dholakia 2024-05-14 22:54:33 -07:00
parent b06f989871
commit 4ff0703a31

View file

@ -865,7 +865,10 @@ Model Info:
# Calculate delta as an aware datetime object with the same timezone as report_sent
delta = report_sent - delta_naive
if current_time >= delta:
current_time_utc = current_time.astimezone(timezone.utc)
delta_utc = delta.astimezone(timezone.utc)
if current_time_utc >= delta_utc:
# Sneak in the reporting logic here
await self.send_daily_reports(router=llm_router)
# Also, don't forget to update the report_sent time after sending the report!