Commit 21d19ad4 authored by Craig Weber's avatar Craig Weber

Get rid of requests.Session usage to reduce issues with reused tcp connections

parent 41a1c84a
......@@ -26,10 +26,6 @@ class HttpTransport(Transport):
#: Timeout for sending a SOAP call. Tuple (CONNECT_TIMEOUT, READ_TIMEOUT)
send_timeout = settings.SEND_TIMEOUT
def __init__(self, **kwargs):
super().__init__()
self.session = requests.Session()
def open(self, request):
"""
......@@ -46,7 +42,7 @@ class HttpTransport(Transport):
if url.startswith('file://'):
content = urllib.request.urlopen(url)
else:
resp = self.session.get(url,
resp = requests.get(url,
proxies=self.proxies(url),
timeout=self.open_timeout)
resp.raise_for_status()
......@@ -68,7 +64,7 @@ class HttpTransport(Transport):
logger.debug('Sending SOAP request: %s' % url)
statsd.incr('soap.send')
with statsd.timer('soap.send'):
resp = self.session.post(url,
resp = requests.post(url,
proxies=self.proxies(url),
timeout=self.send_timeout,
data=msg,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment