Skip to content

Commit

Permalink
Add missing _SECONDS suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkuzmik committed Sep 25, 2024
1 parent e0f585a commit df3f641
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(
max_batch_size: int,
flush_interval_seconds: float,
):
self._flush_interval: float = flush_interval_seconds
self._flush_interval_seconds: float = flush_interval_seconds
self._flush_callback: Callable[[messages.BaseMessage], None] = flush_callback
self._accumulated_messages: List[messages.BaseMessage] = []
self._max_batch_size: int = max_batch_size
Expand All @@ -39,7 +39,7 @@ def flush(self) -> None:
def is_ready_to_flush(self) -> bool:
return (
time.time() - self._last_time_flush_callback_called
) >= self._flush_interval
) >= self._flush_interval_seconds

def is_empty(self) -> bool:
with self._lock:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class FlushingThread(threading.Thread):
def __init__(
self,
batchers: List[base_batcher.BaseBatcher],
probe_interval: float = 0.1,
probe_interval_seconds: float = 0.1,
) -> None:
threading.Thread.__init__(self, daemon=True)
self._batchers = batchers
self._probe_interval = probe_interval
self._probe_interval_seconds = probe_interval_seconds
self._closed = False

def close(self) -> None:
Expand All @@ -27,4 +27,4 @@ def run(self) -> None:
for batcher in self._batchers:
if batcher.is_ready_to_flush():
batcher.flush()
time.sleep(self._probe_interval)
time.sleep(self._probe_interval_seconds)

0 comments on commit df3f641

Please sign in to comment.