mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 21:33:28 +01:00
Do a different DB Ready check for Influx 1 vs 2
This commit is contained in:
@@ -333,6 +333,15 @@ check_availability() {
|
|||||||
;;
|
;;
|
||||||
"influx" )
|
"influx" )
|
||||||
counter=0
|
counter=0
|
||||||
|
case "${INFLUX_VERSION,,}" in
|
||||||
|
1 )
|
||||||
|
while ! (nc -z ${DB_HOST#*//} ${DB_PORT}) ; do
|
||||||
|
sleep 5
|
||||||
|
(( counter+=5 ))
|
||||||
|
print_warn "InfluxDB Host '${DB_HOST#*//}' is not accessible, retrying.. ($counter seconds so far)"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
2 )
|
||||||
code_received=0
|
code_received=0
|
||||||
while [ "${code_received}" != "200" ]; do
|
while [ "${code_received}" != "200" ]; do
|
||||||
code_received=$(curl -XGET -sSL -o /dev/null -w ''%{http_code}'' ${DB_HOST}:${DB_PORT}/health)
|
code_received=$(curl -XGET -sSL -o /dev/null -w ''%{http_code}'' ${DB_HOST}:${DB_PORT}/health)
|
||||||
@@ -342,6 +351,8 @@ check_availability() {
|
|||||||
print_warn "InfluxDB Host '${DB_HOST}' is not accessible, retrying.. ($counter seconds so far)"
|
print_warn "InfluxDB Host '${DB_HOST}' is not accessible, retrying.. ($counter seconds so far)"
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
"mongo" )
|
"mongo" )
|
||||||
counter=0
|
counter=0
|
||||||
while ! (nc -z ${DB_HOST} ${DB_PORT}) ; do
|
while ! (nc -z ${DB_HOST} ${DB_PORT}) ; do
|
||||||
|
|||||||
Reference in New Issue
Block a user