From 42e443fc25c06ce64dabb8c852acb82ca151b84b Mon Sep 17 00:00:00 2001 From: extreme4all <> Date: Mon, 27 Nov 2023 00:30:19 +0100 Subject: [PATCH] small fix --- src/main_v2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main_v2.py b/src/main_v2.py index cd65fec..14159c5 100644 --- a/src/main_v2.py +++ b/src/main_v2.py @@ -182,9 +182,10 @@ async def send_messages(topic: str, producer: AIOKafkaProducer, send_queue: Queu while True: if send_queue.empty(): - start_time, messages_sent = log_speed( - counter=messages_sent, start_time=start_time, _queue=send_queue - ) + if messages_sent > 0: + start_time, messages_sent = log_speed( + counter=messages_sent, start_time=start_time, _queue=send_queue + ) await asyncio.sleep(1) continue message = await send_queue.get()