From 270f8c2772c7c497122a99fbd45c55ed242d3161 Mon Sep 17 00:00:00 2001 From: hoseinaghaei Date: Thu, 15 Feb 2024 04:59:31 +0330 Subject: [PATCH] add log on error. --- kafka_server/broker/file/read.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kafka_server/broker/file/read.py b/kafka_server/broker/file/read.py index 77d9c3c..e782e22 100644 --- a/kafka_server/broker/file/read.py +++ b/kafka_server/broker/file/read.py @@ -150,6 +150,9 @@ def send_to_subscriber(self, key: str, value: str) -> bool: try: response = requests.post(url, json={'key': key, 'value': value}, timeout=2) + if response != 200: + print(response.json(), response.content, response.status_code) + return response.status_code == 200 except Exception as e: print(e)