reverse retry condition
This commit is contained in:
parent
c6a995caee
commit
27160d61bd
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue