curl timeout

This commit is contained in:
qiaofeng1227 2023-06-13 16:31:21 +08:00
parent 60d45e7b51
commit 0015b03769
2 changed files with 2 additions and 2 deletions

View file

@ -322,7 +322,7 @@ function fastest_url() {
fastest_time=0
for url in "${urls[@]}"; do
if curl --output /dev/null --silent --head --fail "$url"; then
if curl --output /dev/null --silent --head --fail --max-time 3 "$url"; then
data="url is available"
else
continue

View file

@ -77,7 +77,7 @@ function fastest_url() {
fastest_time=0
for url in "${urls[@]}"; do
if curl --output /dev/null --silent --head --fail "$url"; then
if curl --output /dev/null --silent --head --fail --max-time 3 "$url"; then
data="url is available"
else
continue