Commit b556ed78 authored by Ian Dennis Miller's avatar Ian Dennis Miller

handle auth error by reconnecting

parent 62393753
Pipeline #261 passed with stage
in 14 seconds
......@@ -38,6 +38,7 @@ class Downloader:
def reconnect(self):
self.disconnect()
time.sleep(1)
self.connect()
def wait_for_reset(self):
......@@ -87,13 +88,15 @@ class Downloader:
count=200,
)
success = True
except TwythonRateLimitError:
except TwythonRateLimitError as e:
print(e)
success = False
self.wait_for_reset()
except TwythonAuthError as e:
print(e)
self.reconnect()
success = False
self.wait_for_reset()
time.sleep(5)
for status in response:
self.snapshot.add_favorite_to_graph(subject, status)
......
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