Skip to content

Commit

Permalink
add timeout to request and fix static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahdi Gheidi committed Feb 15, 2024
1 parent 5b80a5c commit 0001f47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kafka_server/broker/file/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

0 comments on commit 0001f47

Please sign in to comment.