Add wget retry (#2455)

* Add wget retry

Make CMake download more tolerant to network issues

* Sync log message
This commit is contained in:
Konstantin Satunin 2020-09-29 19:10:04 +03:00 committed by GitHub
parent e4875f2a6b
commit 2d3d703445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,8 +22,11 @@ function (DownloadAndCheck from to fatal result)
Download(${from} ${to} ${fatal} ${result} output)
list(GET output 0 status_code)
else()
message(STATUS "${WGET_EXECUTABLE} --no-cache ${from}")
execute_process(COMMAND ${WGET_EXECUTABLE} "--no-cache" "--no-check-certificate" "${from}" "-O" "${to}"
message(STATUS "${WGET_EXECUTABLE} --no-cache --no-check-certificate
--retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=5 ${from}")
execute_process(COMMAND ${WGET_EXECUTABLE} "--no-cache" "--no-check-certificate"
"--retry-connrefused" "--waitretry=1" "--read-timeout=20" "--timeout=15" "--tries=5"
"${from}" "-O" "${to}"
TIMEOUT 2000
RESULT_VARIABLE status_code)
endif()