From 2760dba480083977d179f095f47f28ec1913b9ec Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 11 Dec 2019 21:14:03 +0100 Subject: Properly detect MySQL/slave desynchronization --- lib/adei/adei.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/adei/adei.sh b/lib/adei/adei.sh index 8519af7..fa9dfc3 100644 --- a/lib/adei/adei.sh +++ b/lib/adei/adei.sh @@ -35,7 +35,6 @@ function adei_query { url="$1&mysql=master" fi - resp=$(curl --proxy "" --location-trusted -sf -m "$timeout" "$url"); err=$? if [ $err -ne 0 ]; then resp=$(adei_query "$1" "ecode" "$timeout") @@ -56,9 +55,10 @@ function adei_query { function adei_format_query { local with_auth="${1:-1}" local query="$2" - local timeout=${3:-$adei_default_timeout} - local source=${4:-"$adei_source"} - local url="${5:-$adei_url}" + local database=${3:-master} # ignoring here, it will be handled separately by adei_query + local timeout=${4:-$adei_default_timeout} + local source=${5:-"$adei_source"} + local url="${6:-$adei_url}" auth="" [ $with_auth -gt 0 ] && auth="$adei_auth" @@ -71,7 +71,8 @@ function adei_format_query { function adei_simple_query { local req=$(adei_format_query 1 "$@") - adei_query "$req" "master" "$timeout"; err=$? + local database=${2:-master} + adei_query "$req" $database "$timeout"; err=$? return $err } -- cgit v1.2.3