From 2d3d7034454cef01cca0d0d10b24db7a592e929e Mon Sep 17 00:00:00 2001 From: Konstantin Satunin Date: Tue, 29 Sep 2020 19:10:04 +0300 Subject: [PATCH] Add wget retry (#2455) * Add wget retry Make CMake download more tolerant to network issues * Sync log message --- cmake/download/download_and_check.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/download/download_and_check.cmake b/cmake/download/download_and_check.cmake index 83f8e840e59..b18c4e3377b 100644 --- a/cmake/download/download_and_check.cmake +++ b/cmake/download/download_and_check.cmake @@ -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()