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

Unified Diff: tools/findit/chromium_deps.py

Issue 478763003: [Findit] Bug fixing and implemented some feature requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed codereview and removed all references to logging Created 6 years, 4 months 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: tools/findit/chromium_deps.py
diff --git a/tools/findit/chromium_deps.py b/tools/findit/chromium_deps.py
index f86dd93c803a465bfb8423107cecb3a6e1d421e1..e2b0b7c8c867c1eb23f42f6fb8866cb12d420c4a 100644
--- a/tools/findit/chromium_deps.py
+++ b/tools/findit/chromium_deps.py
@@ -5,6 +5,8 @@
import base64
import json
import os
+import time
+import urllib2
from common import utils
@@ -64,9 +66,22 @@ def _GetComponentName(path, host_dirs):
return '_'.join(path.split('/'))
-def _GetContentOfDEPS(url):
- _, content = utils.GetHttpClient().Get(url, timeout=60)
- return content
+def _GetContentOfDEPS(url, retries=5, sleep_time=0.1):
+ count = 0
+ while True:
+ count += 1
+ try:
+ _, content = utils.GetHttpClient().Get(url, timeout=60)
+ return content
+
+ # TODO(jeun): Handle HTTP Errors, such as 404.
+ except urllib2.HTTPError:
+ if count < retries:
+ time.sleep(sleep_time)
+ else:
+ break
+
+ return ''
def GetChromiumComponents(chromium_revision,

Powered by Google App Engine
This is Rietveld 408576698