mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 18:55:23 +03:00
fix python checks
This commit is contained in:
parent
cff9f69a9c
commit
46c65d60b6
@ -679,14 +679,12 @@ class EventsPerSecond:
|
|||||||
# avoid divide by zero
|
# avoid divide by zero
|
||||||
if seconds == 0:
|
if seconds == 0:
|
||||||
seconds = 1
|
seconds = 1
|
||||||
return (
|
return len(self._timestamps) / seconds
|
||||||
len(self._timestamps) / seconds
|
|
||||||
)
|
|
||||||
|
|
||||||
# remove aged out timestamps
|
# remove aged out timestamps
|
||||||
def expire_timestamps(self, now):
|
def expire_timestamps(self, now):
|
||||||
threshold = now - self._last_n_seconds
|
threshold = now - self._last_n_seconds
|
||||||
while (self._timestamps and self._timestamps[0] < threshold):
|
while self._timestamps and self._timestamps[0] < threshold:
|
||||||
del self._timestamps[0]
|
del self._timestamps[0]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user