/// Check the remote Action Cache for a cached result of running the given `action_digest`.
///
/// This check is necessary because some RE servers do not short-circuit the Execute method
/// by checking the Action Cache (e.g., BuildBarn). Thus, this client must check the cache
/// explicitly in order to avoid duplicating already-cached work. This behavior matches
/// the Bazel RE client.
Check the remote Action Cache for a cached result of running the given `action_digest`.
This check is necessary because some RE servers do not short-circuit the Execute method
by checking the Action Cache . Thus, this client must check the cache
explicitly in order to avoid duplicating already-cached work. This behavior matches
the Bazel RE client.
Check the remote Action Cache for a cached result of running the given ` action_digest ` . This check is necessary because some RE servers do not short - circuit the Execute method by checking the Action Cache . Thus this client must check the cache explicitly in order to avoid duplicating already - cached work . This behavior matches the Bazel RE client .
async fn check_action_cache(
    &self,
    action_digest: Digest,
    metadata: &ProcessMetadata,
    context: &Context,
  ) -> Result<Option<FallibleProcessResultWithPlatform>, String> {
    let mut request = bazel_protos::remote_execution::GetActionResultRequest::new();
    if let Some(ref instance_name) = metadata.instance_name {
      request.set_instance_name(instance_name.clone());
    }
    request.set_action_digest(action_digest.into());
    let call_opt = call_option(&self.headers, Some(context.build_id.clone()))?;
    let action_result_response = self
      .action_cache_client
      .get_action_result_async_opt(&request, call_opt)
      .unwrap()
      .compat()
      .await;
    match action_result_response {
      Ok(action_result) => {
        let response = populate_fallible_execution_result(
          self.store.clone(),
          &action_result,
          vec![],
          self.platform,
        )
        .compat()
        .await?;
        Ok(Some(response))
      }
      Err(err) => match err {
        grpcio::Error::RpcFailure(rpc_status)
          if rpc_status.status == grpcio::RpcStatusCode::NOT_FOUND =>
        {
          Ok(None)
        }
        _ => Err(rpcerror_to_string(err)),
      },
    }
  }
async fn check_action_cache ( & self , action_digest : Digest , metadata : & ProcessMetadata , context : & Context , ) -> Result < Option < FallibleProcessResultWithPlatform > , String > { let mut request = bazel_protos :: remote_execution :: GetActionResultRequest :: new ( ) ; if let Some ( ref instance_name ) = metadata . instance_name { request . set_instance_name ( instance_name . clone ( ) ) ; } request . set_action_digest ( action_digest . into ( ) ) ; let call_opt = call_option ( & self . headers , Some ( context . build_id . clone ( ) ) ) ? ; let action_result_response = self . action_cache_client . get_action_result_async_opt ( & request , call_opt ) . unwrap ( ) . compat ( ) . await ; match action_result_response { Ok ( action_result ) => { let response = populate_fallible_execution_result ( self . store . clone ( ) , & action_result , vec ! [ ] , self . platform , ) . compat ( ) . await ? ; Ok ( Some ( response ) ) } Err ( err ) => match err { grpcio :: Error :: RpcFailure ( rpc_status ) if rpc_status . status == grpcio :: RpcStatusCode :: NOT_FOUND => { Ok ( None ) } _ => Err ( rpcerror_to_string ( err ) ) , } , } }
Check the remote Action Cache for a cached result of running the given `action_digest`.
Check the remote Action Cache for a cached result of running the given ` action_digest ` .
&self
action_digest
Digest
metadata
&ProcessMetadata
context
&Context