diff options
author | Pjotr Prins | 2020-11-11 17:24:18 +0000 |
---|---|---|
committer | Pjotr Prins | 2020-11-11 17:24:18 +0000 |
commit | 7f3c8b8486cd215b63f6d7c493ff40d0f0106b9f (patch) | |
tree | 5a1b7f923633c5bca2e803d2cc81a2bcbd97e774 /bh20simplewebuploader | |
parent | 7fe362b6d9ee21bc585b618f9de468254aa5f4d7 (diff) | |
download | bh20-seq-resource-7f3c8b8486cd215b63f6d7c493ff40d0f0106b9f.tar.gz bh20-seq-resource-7f3c8b8486cd215b63f6d7c493ff40d0f0106b9f.tar.lz bh20-seq-resource-7f3c8b8486cd215b63f6d7c493ff40d0f0106b9f.zip |
Conflict in guix-deploy
Diffstat (limited to 'bh20simplewebuploader')
-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) |