mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-19 05:35:17 +01:00
Working version of the async pub/sub notifier for callbacks
This commit is contained in:
@@ -113,23 +113,11 @@ build_callback_txid() {
|
||||
curl_callback_txid() {
|
||||
trace "Entering curl_callback_txid()..."
|
||||
|
||||
local url=${1}
|
||||
local data=${2}
|
||||
local returncode
|
||||
|
||||
trace "[curl_callback_txid] curl -w \"%{http_code}\" -H \"Content-Type: application/json\" -H \"X-Forwarded-Proto: https\" -d \"${data}\" ${url}"
|
||||
rc=$(curl -w "%{http_code}" -H "Content-Type: application/json" -H "X-Forwarded-Proto: https" -d "${data}" ${url})
|
||||
notify_web "${1}" "${2}"
|
||||
returncode=$?
|
||||
trace "[curl_callback_txid] HTTP return code=${rc}"
|
||||
trace_rc ${returncode}
|
||||
|
||||
if [ "${returncode}" -eq "0" ]; then
|
||||
if [ "${rc}" -lt "400" ]; then
|
||||
return 0
|
||||
else
|
||||
return ${rc}
|
||||
fi
|
||||
else
|
||||
return ${returncode}
|
||||
fi
|
||||
return ${returncode}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user