Skip to content

Commit

Permalink
use timeout for post()
Browse files Browse the repository at this point in the history
  • Loading branch information
vladak authored Feb 11, 2024
1 parent 6c1134b commit 7be61cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mq2anno.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def create_annotation(userdata, tag):
payload_str = json.dumps(payload)
logger.debug(f"posting {payload_str} with {userdata.headers} to {url}")
try:
response = requests.post(url, data=payload_str, headers=userdata.headers)
response = requests.post(url, data=payload_str, headers=userdata.headers, timeout=3)
if response.status_code != 200:
logger.error(f"Failed to post {payload_str} to {url}: {response.text}")
except requests.exceptions.ConnectionError as exc:
Expand Down

0 comments on commit 7be61cd

Please sign in to comment.