Lower the retry count in download fetcher if the update is interactive. am: ee174a1ac2 am: 639fdaa710
am: b67946e541
Change-Id: I9b0dec2245ff9a3c189d9c2e495e0fb2d0a78cbf
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(),