def get_lock(key, value=None, expiry_time=60):
    """Get a distribute lock"""
    from uliweb.utils.common import get_uuid

    redis = get_redis()
    value = value or get_uuid()
    return redis.set(key, value, ex=expiry_time, nx=True)
Get a distribute lock