Jump out loop when complete

This commit is contained in:
Teerapatr K
2021-10-22 14:04:54 +07:00
parent 1cd014b165
commit 4488d113ef

View File

@@ -237,6 +237,7 @@ backup_redis() {
ok=$(echo 'info Persistence' | redis-cli -h ${dbhost} -p ${dbport} ${REDIS_PASS_STR} | awk '/rdb_last_bgsave_status:ok/{print "ok"}') ok=$(echo 'info Persistence' | redis-cli -h ${dbhost} -p ${dbport} ${REDIS_PASS_STR} | awk '/rdb_last_bgsave_status:ok/{print "ok"}')
if [[ "$saved" = "saved" ]] && [[ "$ok" = "ok" ]]; then if [[ "$saved" = "saved" ]] && [[ "$ok" = "ok" ]]; then
print_info "Redis Backup Complete" print_info "Redis Backup Complete"
break
fi fi
try=$((try - 1)) try=$((try - 1))
print_info "Redis Busy - Waiting and retrying in 5 seconds" print_info "Redis Busy - Waiting and retrying in 5 seconds"