mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-01-07 15:05:41 +01:00
Added timeouts on curl calls
This commit is contained in:
@@ -15,8 +15,8 @@ notify_web() {
|
||||
local http_code
|
||||
|
||||
# We use the pid as the response-topic, so there's no conflict in responses.
|
||||
trace "[notify_web] mosquitto_rr -h broker -W 5 -t notifier -e \"response/$$\" -m \"{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${body}\"}\""
|
||||
response=$(mosquitto_rr -h broker -W 5 -t notifier -e "response/$$" -m "{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${body}\"}")
|
||||
trace "[notify_web] mosquitto_rr -h broker -W 21 -t notifier -e \"response/$$\" -m \"{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${body}\"}\""
|
||||
response=$(mosquitto_rr -h broker -W 21 -t notifier -e "response/$$" -m "{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${body}\"}")
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ send_to_bitcoin_node()
|
||||
local config=${2}
|
||||
local data=${3}
|
||||
|
||||
trace "[send_to_bitcoin_node] curl -s --config ${config} -H \"Content-Type: application/json\" -d \"${data}\" ${node_url}"
|
||||
result=$(curl -s --config ${config} -H "Content-Type: application/json" -d "${data}" ${node_url})
|
||||
trace "[send_to_bitcoin_node] curl -m 20 -s --config ${config} -H \"Content-Type: application/json\" -d \"${data}\" ${node_url}"
|
||||
result=$(curl -m 20 -s --config ${config} -H "Content-Type: application/json" -d "${data}" ${node_url})
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
trace "[send_to_bitcoin_node] result=${result}"
|
||||
|
||||
Reference in New Issue
Block a user