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

Unified Diff: tools/findit/common/http_client.py

Issue 538383002: [Findit] Make Findit more robust. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Workaround python bug. Created 6 years, 3 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/common/http_client.py
diff --git a/tools/findit/common/http_client.py b/tools/findit/common/http_client.py
index 82c358dedaae8a7724bd01d8be2bbd9057f6705a..75dd410d0e7eb425e2ed56c540e62ca4042eb449 100644
--- a/tools/findit/common/http_client.py
+++ b/tools/findit/common/http_client.py
@@ -10,9 +10,19 @@ class HttpClient(object):
"""
@staticmethod
- def Get(url, params={}, timeout=None):
+ def Get(url, params={}, timeout=60, retries=5, retry_interval=0.5,
+ retry_if_not=None):
"""Send a GET request to the given url with the given parameters.
+ Args:
+ url: the url to send request to.
+ params: parameters to send as part of the http request.
+ timeout: timeout for the http request, default is 60 seconds.
+ retries: indicate how many retries before failing, default is 5.
+ retry_interval: interval in second to wait before retry, default is 0.5.
+ retry_if_not: a http status code. If set, retry only when the failed http
+ status code is a different value.
+
Returns:
(status_code, data)
state_code: the http status code in the response.

Powered by Google App Engine
This is Rietveld 408576698