Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8237)

Unified Diff: components/ntp_snippets/remote/ntp_snippets_fetcher.cc

Issue 2548343002: NTPSnippets: Set MaxRetriesOn5xx only for interactive requests. (Closed)
Patch Set: Use TestURLFetcher instead of helper function. Rebased. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/remote/ntp_snippets_fetcher.cc
diff --git a/components/ntp_snippets/remote/ntp_snippets_fetcher.cc b/components/ntp_snippets/remote/ntp_snippets_fetcher.cc
index 62236a8a375cab50981b1a7798b0ce55f963798c..94b5183ea1823f040921136dcabcd576ea1a777a 100644
--- a/components/ntp_snippets/remote/ntp_snippets_fetcher.cc
+++ b/components/ntp_snippets/remote/ntp_snippets_fetcher.cc
@@ -812,8 +812,14 @@ NTPSnippetsFetcher::RequestBuilder::BuildURLFetcher(
// Fetchers are sometimes cancelled because a network change was detected.
url_fetcher->SetAutomaticallyRetryOnNetworkChanges(3);
- // Try to make fetching the files bit more robust even with poor connection.
- url_fetcher->SetMaxRetriesOn5xx(3);
+ if (params_.interactive_request) {
+ // Try to make fetching the files bit more robust even with poor connection.
+ url_fetcher->SetMaxRetriesOn5xx(2);
+ } else {
+ // Don't retry immediately if a scheduled fetch fails.
+ // TODO(fhorschig): back off for 1h (+1h jitter) and then retry.
Marc Treib 2016/12/06 16:06:56 I'm not convinced we actually want to do this :) M
fhorschig 2016/12/08 10:20:58 Done already. I removed this comment for now as I
+ url_fetcher->SetMaxRetriesOn5xx(0);
Marc Treib 2016/12/06 16:06:56 As discussed offline: Should we introduce a variat
fhorschig 2016/12/08 10:20:58 Done.
+ }
return url_fetcher;
}

Powered by Google App Engine
This is Rietveld 408576698