##// END OF EJS Templates
http: ported old depracated retry format for http client.
marcink -
r1958:7ffffec9 default
parent child Browse files
Show More
@@ -255,14 +255,13 b' class WebhookIntegrationType(Integration'
255 255 @task(ignore_result=True)
256 256 def post_to_webhook(url_calls, settings):
257 257 max_retries = 3
258 for url, token, data in url_calls:
259 # retry max N times
260 258 retries = Retry(
261 259 total=max_retries,
262 260 backoff_factor=0.15,
263 261 status_forcelist=[500, 502, 503, 504])
262 for url, token, data in url_calls:
264 263 req_session = requests.Session()
265 req_session.mount(
264 req_session.mount( # retry max N times
266 265 'http://', requests.adapters.HTTPAdapter(max_retries=retries))
267 266
268 267 method = settings.get('method_type') or 'post'
@@ -32,6 +32,7 b' import uuid'
32 32 import pycurl
33 33 import msgpack
34 34 import requests
35 from requests.packages.urllib3.util.retry import Retry
35 36
36 37 from . import exceptions, CurlSession
37 38
@@ -232,7 +233,11 b' class VcsHttpProxy(object):'
232 233 CHUNK_SIZE = 16384
233 234
234 235 def __init__(self, server_and_port, backend_endpoint):
235 adapter = requests.adapters.HTTPAdapter(max_retries=5)
236
237
238 retries = Retry(total=5, connect=None, read=None, redirect=None)
239
240 adapter = requests.adapters.HTTPAdapter(max_retries=retries)
236 241 self.base_url = urlparse.urljoin(
237 242 'http://%s' % server_and_port, backend_endpoint)
238 243 self.session = requests.Session()
General Comments 0
You need to be logged in to leave comments. Login now