From 0001f47888f445f44a222062e490f0d14c465db5 Mon Sep 17 00:00:00 2001 From: Mahdi Gheidi Date: Thu, 15 Feb 2024 12:38:42 +0330 Subject: [PATCH] add timeout to request and fix static analysis --- kafka_server/broker/file/indexer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka_server/broker/file/indexer.py b/kafka_server/broker/file/indexer.py index 7476ff9..5b50d60 100644 --- a/kafka_server/broker/file/indexer.py +++ b/kafka_server/broker/file/indexer.py @@ -110,6 +110,6 @@ def send_to_replica(self): url = f'{self.replica}/replica/index' data = {'partition': self.partition, 'read': self._read, 'sync': self._sync} print(data, "to Replica") - response = requests.post(url, json=data) + response = requests.post(url, json=data, timeout=2) if response.status_code != 200: raise Exception(f'indexed not yet updated {response}')