mirror of https://github.com/dapr/quickstarts.git
Add timeout to HTTP requests in Python samples (#219)
* Add timeout to request to avoid endless hangs * Add timeout to request to avoid endless hangs
This commit is contained in:
parent
ea1739e07d
commit
da05bb0180
|
|
@ -16,7 +16,7 @@ while True:
|
|||
message = {"data": {"orderId": n}}
|
||||
|
||||
try:
|
||||
response = requests.post(dapr_url, json=message)
|
||||
response = requests.post(dapr_url, json=message, timeout=5)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ while True:
|
|||
message = {"data": {"orderId": n}}
|
||||
|
||||
try:
|
||||
response = requests.post(dapr_url, json=message)
|
||||
response = requests.post(dapr_url, json=message, timeout=5)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue