Skip to content

Commit 30e9511

Browse files
h00dieB0yCopilot
andauthored
Update utils/main.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c12dad0 commit 30e9511

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

utils/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@
4545
logger.warning("Failed to fetch story %s: %s", story_id, e)
4646
continue
4747

48-
producer.flush()
48+
try:
49+
producer.flush()
50+
except Exception as e:
51+
logger.error("Error while flushing Kafka producer: %s", e)
4952
except requests.RequestException as e:
5053
logger.warning("API error: %s", e)
5154

0 commit comments

Comments
 (0)