Update common/common.cpp
Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
This commit is contained in:
parent
3a957ec149
commit
23eba9bf55
1 changed files with 1 additions and 1 deletions
|
@ -2365,7 +2365,7 @@ static bool llama_download_file(const std::string & url, const std::string & pat
|
||||||
while (remaining_request_attempts > 0){
|
while (remaining_request_attempts > 0){
|
||||||
CURLcode res = curl_easy_perform(curl.get());
|
CURLcode res = curl_easy_perform(curl.get());
|
||||||
if (res != CURLE_OK) {
|
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);
|
fprintf(stderr, "%s: curl_easy_perform() failed: %s, retrying after %d miliseconds\n", __func__, curl_easy_strerror(res), exponential_backoff_delay);
|
||||||
remaining_request_attempts--;
|
remaining_request_attempts--;
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(exponential_backoff_delay));
|
std::this_thread::sleep_for(std::chrono::milliseconds(exponential_backoff_delay));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue