Пример #1
0
def send_periodic_session_update(
        upf_session_config_state: UPFSessionConfigState,
        setinterface_stub: SetInterfaceForUserPlaneStub):
    """
    Make RPC call to send periodic messages to smf about sessions state.
    """
    try:
        setinterface_stub.SetUPFSessionsConfig(upf_session_config_state)
        return True
    except grpc.RpcError as err:
        logging.error("send_periodic_session_update error[%s] %s", err.code(),
                      err.details())
        return False
Пример #2
0
def send_periodic_session_update(
    upf_session_config_state: UPFSessionConfigState,
    setinterface_stub: SetInterfaceForUserPlaneStub,
):
    """
    Make RPC call to send periodic messages to smf about sessions state.
    """
    try:
        setinterface_stub.SetUPFSessionsConfig(upf_session_config_state, DEFAULT_GRPC_TIMEOUT)
        return True
    except grpc.RpcError as err:
        logging.error(
            "send_periodic_session_update error[%s] %s",
            err.code(),
            err.details(),
            extra=EXCLUDE_FROM_ERROR_MONITORING if indicates_connection_error(err) else None,
        )
        return False