Commit 6749f835 authored by Aaron Hill's avatar Aaron Hill
Browse files

Reset session after making request

parent a1c9d4f3
......@@ -186,6 +186,7 @@ def bind_api(**config):
time.sleep(retry_delay)
retries_performed += 1
self.session = requests.Session()
# If an error was returned, throw an exception
self.api.last_response = resp
if resp.status_code and not 200 <= resp.status_code < 300:
......
......@@ -189,6 +189,8 @@ class Stream(object):
if resp:
resp.close()
self.session = requests.Session()
if exception:
# call a handler first so that the exception can be logged.
self.listener.on_exception(exception)
......
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