fixing timezone issues

This commit is contained in:
Alpha Nerd 2025-11-20 12:53:18 +01:00
parent 0d187e91b9
commit aa23a4dd81
2 changed files with 87 additions and 31 deletions

View file

@ -226,9 +226,9 @@ async def token_worker() -> None:
token_buffer[endpoint].get(model, (0, 0))[1] + comp
)
# Add to time series buffer with timestamp
# Add to time series buffer with timestamp (UTC)
now = datetime.now(tz=timezone.utc)
timestamp = int(datetime(now.year, now.month, now.day, now.hour, now.minute).timestamp())
timestamp = int(datetime(now.year, now.month, now.day, now.hour, now.minute, tzinfo=timezone.utc).timestamp())
time_series_buffer.append({
'endpoint': endpoint,
'model': model,