mirror of
https://github.com/chubin/wttr.in
synced 2025-01-27 19:15:10 +00:00
minor cleanup
This commit is contained in:
parent
f9e38c367d
commit
bdfb02ed44
1 changed files with 7 additions and 4 deletions
|
@ -97,11 +97,14 @@ class Limits:
|
|||
% (interval, self.limit[interval]))
|
||||
|
||||
def clear_counters(self):
|
||||
t = int( time.time() )
|
||||
"""
|
||||
Initialize counters for new interval
|
||||
"""
|
||||
t_int = int(time.time())
|
||||
for interval in self.intervals:
|
||||
if t / self.divisor[interval] != self.last_update[interval]:
|
||||
if t_int / self.divisor[interval] != self.last_update[interval]:
|
||||
self.counter[interval] = {}
|
||||
self.last_update[interval] = t / self.divisor[interval]
|
||||
self.last_update[interval] = t_int / self.divisor[interval]
|
||||
|
||||
limits = Limits()
|
||||
|
||||
|
|
Loading…
Reference in a new issue