--- a/algodai_reality_gap_fixture.py +++ b/algodai_reality_gap_fixture.py @@ -10,7 +10,7 @@ self._timestamps = deque() def allow(self, now: float) -> bool: - while self._timestamps and self._timestamps[0] - now > self.window_seconds: + while self._timestamps and now - self._timestamps[0] >= self.window_seconds: self._timestamps.popleft() if len(self._timestamps) < self.max_requests: self._timestamps.append(now)