Lower the retry count in download fetcher if the update is interactive.
am: ee174a1ac2
Change-Id: I6e1e48dc8238129af2ffddef4b9d9b122cc67ad2
diff --git a/common/constants.h b/common/constants.h
index fefd08c..26773cf 100644
--- a/common/constants.h
+++ b/common/constants.h
@@ -176,6 +176,7 @@
// succeeding. When using p2p, this is low in order to fail fast.
const int kDownloadMaxRetryCount = 20;
const int kDownloadMaxRetryCountOobeNotComplete = 3;
+const int kDownloadMaxRetryCountInteractive = 3;
const int kDownloadP2PMaxRetryCount = 5;
// The connect timeout, in seconds.
diff --git a/update_attempter.cc b/update_attempter.cc
index d955c7f..cc9cb8f 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -619,6 +619,8 @@
LibcurlHttpFetcher* download_fetcher =
new LibcurlHttpFetcher(GetProxyResolver(), system_state_->hardware());
download_fetcher->set_server_to_check(ServerToCheck::kDownload);
+ if (interactive)
+ download_fetcher->set_max_retry_count(kDownloadMaxRetryCountInteractive);
shared_ptr<DownloadAction> download_action(
new DownloadAction(prefs_,
system_state_->boot_control(),