// TODO: Maybe record WorkUnits for local cache checks.
Maybe record WorkUnits for local cache checks.
Maybe record WorkUnits for local cache checks .
fn run(
    &self,
    req: MultiPlatformExecuteProcessRequest,
    workunit_store: WorkUnitStore,
  ) -> BoxFuture<FallibleExecuteProcessResult, String> {
    let digest = self.digest(req.clone());
    let key = digest.0;
    let command_runner = self.clone();
    self
      .lookup(key, workunit_store.clone())
      .then(move |maybe_result| {
        match maybe_result {
          Ok(Some(result)) => return futures::future::ok(result).to_boxed(),
          Err(err) => {
            warn!("Error loading process execution result from local cache: {} - continuing to execute", err);
            // Falling through to re-execute.
          },
          Ok(None) => {
            // Falling through to execute.
          },
        }
        command_runner
            .underlying
            .run(req, workunit_store)
            .and_then(move |result| {
              command_runner.store(key, &result).then(|store_result| {
                if let Err(err) = store_result {
                  debug!("Error storing process execution result to local cache: {} - ignoring and continuing", err);
                }
                Ok(result)
              })
            })
            .to_boxed()
      })
      .to_boxed()
  }
fn run ( & self , req : MultiPlatformExecuteProcessRequest , workunit_store : WorkUnitStore , ) -> BoxFuture < FallibleExecuteProcessResult , String > { let digest = self . digest ( req . clone ( ) ) ; let key = digest . 0 ; let command_runner = self . clone ( ) ; self . lookup ( key , workunit_store . clone ( ) ) . then ( move | maybe_result | { match maybe_result { Ok ( Some ( result ) ) => return futures :: future :: ok ( result ) . to_boxed ( ) , Err ( err ) => { warn ! ( " " err ) ; // Falling through to re-execute. } , Ok ( None ) => { // Falling through to execute. } , } command_runner . underlying . run ( req , workunit_store ) . and_then ( move | result | { command_runner . store ( key , & result ) . then ( | store_result | { if let Err ( err ) = store_result { debug ! ( " " err ) ; } Ok ( result ) } ) } ) . to_boxed ( ) } ) . to_boxed ( ) }
TODO: Maybe record WorkUnits for local cache checks.
TODO : Maybe record WorkUnits for local cache checks .
&self
req
MultiPlatformExecuteProcessRequest
workunit_store
WorkUnitStore