diff options
Diffstat (limited to 'bh20simplewebuploader/main.py')
-rw-r--r-- | bh20simplewebuploader/main.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index 1d7154c..e69caa1 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -257,12 +257,16 @@ def send_home(): port=os.environ.get('PORT', 6379), db=os.environ.get('REDIS_DB', 0)) tweets = [] - for tweet_id in redis_client.zrevrange('bh20-tweet-score:', - 0, -1): - tweets.append( - {k.decode("utf-8"): v.decode("utf-8") for k, v in - redis_client.hgetall(tweet_id).items()} - ) + try: + for tweet_id in redis_client.zrevrange('bh20-tweet-score:', + 0, -1): + tweets.append( + {k.decode("utf-8"): v.decode("utf-8") for k, v in + redis_client.hgetall(tweet_id).items()} + ) + except redis.exceptions.ConnectionError as e: + logging.warning(e) + pass return render_template('home.html', menu='HOME', tweets=tweets, load_map=True) |