(backend, exception)
Only returns True if the exception hasn't been logged for the given backend
    in the last hour.
Only returns True if the exception hasn't been logged for the given backend
    in the last hour.
Only returns True if the exception hasn t been logged for the given backend in the last hour .
def should_log_exception_for_backend(backend, exception):
    """
    Only returns True if the exception hasn't been logged for the given backend
    in the last hour.
    """
    client = get_redis_client()
    key = f'exception-logged-for-backend-{backend.couch_id}-{hash(str(exception))}'

    if client.get(key):
        return False
    else:
        client.set(key, 1)
        client.expire(key, 60 * 60)
        return True
def should_log_exception_for_backend ( backend , exception ) : client = get_redis_client ( ) key = f'exception-logged-for-backend-{backend.couch_id}-{hash(str(exception))}' if client . get ( key ) : return False else : client . set ( key , 1 ) client . expire ( key , 60 * 60 ) return True