reverse retry condition

This commit is contained in:
Von Random 2018-11-09 14:44:47 +03:00
parent c6a995caee
commit 27160d61bd

View file

@ -16,13 +16,13 @@ class PluginThread(plugins.PluginThreadCommon):
try: try:
req = requests.get(URI, timeout=2) req = requests.get(URI, timeout=2)
advice = req.json()['text'] if req.status_code == 200 else 'N/A' advice = req.json()['text'] if req.status_code == 200 else 'N/A'
self.retry = True self.retry = False
except requests.exceptions.Timeout: except requests.exceptions.Timeout:
advice = 'N/A (timeout)' advice = 'N/A (timeout)'
self.retry = False self.retry = True
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:
advice = 'N/A (offline)' advice = 'N/A (offline)'
self.retry = False self.retry = True
self.status['full_text'] = advice self.status['full_text'] = advice