Curl retry mechanism

后端 未结 3 463
梦毁少年i
梦毁少年i 2020-12-30 18:54

I have a script I run to deploy 2 web services and a front-end application. The script calls a method that checks to see if the 2 back-end services are up and running. If so

3条回答
  •  情歌与酒
    2020-12-30 19:28

    If you use --max-time 10 this will kill your connection before 10 seconds so its not useful when downloading.

    Following will retry 300 times with 5sec delay and 30sec connection timeout

    curl \
        --connect-timeout 30 \
        --retry 300 \
        --retry-delay 5 \
        URL
    

提交回复
热议问题