def redis_check():
    try:
        redis = cache.caches['redis']
        result = redis.set('serverup_check_key', 'test')
    except (InvalidCacheBackendError, __HOLE__):
        result = True  # redis not in use, ignore
    except:
        result = False
    return (result, None)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqwebapp/views.py/redis_check