Update common/common.cpp

Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
This commit is contained in:
Farbod Bijary 2024-08-31 17:09:29 +03:30 committed by GitHub
parent 3a957ec149
commit 23eba9bf55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2365,7 +2365,7 @@ static bool llama_download_file(const std::string & url, const std::string & pat
while (remaining_request_attempts > 0){
CURLcode res = curl_easy_perform(curl.get());
if (res != CURLE_OK) {
int exponential_backoff_delay = std::pow(retry_delay, (head_request_attempts - remaining_request_attempts)) * 1000;
int exponential_backoff_delay = std::pow(CURL_RETRY_DELAY_SECONDS, (CURL_MAX_RETRY - remaining_request_attempts)) * 1000;
fprintf(stderr, "%s: curl_easy_perform() failed: %s, retrying after %d miliseconds\n", __func__, curl_easy_strerror(res), exponential_backoff_delay);
remaining_request_attempts--;
std::this_thread::sleep_for(std::chrono::milliseconds(exponential_backoff_delay));