From e0b2b0095c256173c71280af6e07aab2c7747212 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Wed, 14 Jul 2021 00:16:10 -0700 Subject: [PATCH] catch condition where you don't hear back --- app/library/cache.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/library/cache.py b/app/library/cache.py index c783a47..9279f9d 100644 --- a/app/library/cache.py +++ b/app/library/cache.py @@ -34,8 +34,11 @@ class Cache(object): dns = f'{codename}.node.{config.DO_DOMAIN}' url = f'https://{dns}/tor/' r = r_get(url, timeout=6) - data = r.text.strip() - self.store_data(key_name, 86400, data) + if r.text: + data = r.text.strip() + self.store_data(key_name, 86400, data) + else: + data = '' return data except: return {'error': 'true'}