Update core.func
This commit is contained in:
parent
ec09590df3
commit
127dd92de7
@ -149,7 +149,7 @@ curl_handler() {
|
|||||||
|
|
||||||
while [[ $attempt -le $max_retries ]]; do
|
while [[ $attempt -le $max_retries ]]; do
|
||||||
if $has_output_file; then
|
if $has_output_file; then
|
||||||
run_curl "${args[@]}"
|
$STD run_curl "${args[@]}"
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
else
|
else
|
||||||
result=$(run_curl "${args[@]}")
|
result=$(run_curl "${args[@]}")
|
||||||
@ -157,7 +157,7 @@ curl_handler() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $exit_code -eq 0 ]]; then
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
msg_ok "Fetched: $url"
|
$STD msg_ok "Fetched: $url"
|
||||||
$has_output_file || printf '%s' "$result"
|
$has_output_file || printf '%s' "$result"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@ -173,7 +173,7 @@ curl_handler() {
|
|||||||
return 1 # Return error instead of exit to allow script to continue
|
return 1 # Return error instead of exit to allow script to continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "\r\033[K${INFO}${YW}Retry $attempt/$max_retries in ${delay}s...${CL}" >&2
|
$STD printf "\r\033[K${INFO}${YW}Retry $attempt/$max_retries in ${delay}s...${CL}" >&2
|
||||||
sleep "$delay"
|
sleep "$delay"
|
||||||
((attempt++))
|
((attempt++))
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user