fix budget refresh logic for "Never"

This commit is contained in:
Riccardo Balbo 2026-05-19 15:22:45 +02:00
commit 1d001d6e10
2 changed files with 74 additions and 1 deletions

View file

@ -39,7 +39,7 @@ class NWCBudget(BaseModel):
c = int(time.time())
if self.refresh_window <= 0: # never refresh
# return a timestamp in the future
return c, c + 21000000
return self.created_at, c + 21000000
# calculate the next refresh timestamp
elapsed = c - self.created_at
passed_cycles = elapsed // self.refresh_window