Replace else-if with elif.
This commit is contained in:
parent
1d0f96a966
commit
9b8b0b6339
1 changed files with 9 additions and 8 deletions
|
@ -52,9 +52,10 @@ class Ratelimiter:
|
|||
if self.balance >= cost:
|
||||
self.balance -= cost
|
||||
successful = True
|
||||
else:
|
||||
if self.mode == 'reject':
|
||||
|
||||
elif self.mode == 'reject':
|
||||
successful = False
|
||||
|
||||
else:
|
||||
deficit = cost - self.balance
|
||||
time_needed = deficit / self.gain_rate
|
||||
|
|
Loading…
Reference in a new issue