Browse Source

Wait for other executions on failure

master
Adrian Heine 4 years ago
parent
commit
a155a1f7a8
  1. 1
      src/async_utils.rs
  2. 15
      src/setup/core.rs

1
src/async_utils.rs

@ -16,6 +16,7 @@ pub fn run<F: Future>(future: F) -> F::Output {
.unwrap() .unwrap()
.block_on(future) .block_on(future)
} }
pub use tokio::join;
pub use tokio::try_join; pub use tokio::try_join;
#[derive(Debug)] #[derive(Debug)]

15
src/setup/core.rs

@ -2,7 +2,7 @@ use super::runnable::Runnable;
use super::setup::Setup; use super::setup::Setup;
use super::util::{AddableResource, InternalAddResult}; use super::util::{AddableResource, InternalAddResult};
use super::SymbolRunner; use super::SymbolRunner;
use crate::async_utils::try_join;
use crate::async_utils::join;
use crate::loggers::{Logger, StoringLogger}; use crate::loggers::{Logger, StoringLogger};
use crate::resources::{FromArtifact, FromResource}; use crate::resources::{FromArtifact, FromResource};
use crate::symbols::Symbol; use crate::symbols::Symbol;
@ -36,11 +36,16 @@ macro_rules! add_generic {
#[allow(unused)] #[allow(unused)]
async fn add_generic(&self, ($($name,)*): ($($name,)*)) -> Result<(StoringLogger, ($($name::Artifact,)*), bool), (StoringLogger, Box<dyn Error>)> async fn add_generic(&self, ($($name,)*): ($($name,)*)) -> Result<(StoringLogger, ($($name::Artifact,)*), bool), (StoringLogger, Box<dyn Error>)>
{ {
let x: Result<_, _> = try_join!($(self.add($name, false),)*);
let ($($name,)*) = x?;
let ($($name,)*) = join!($(self.add($name, false),)*);
let logger = StoringLogger::default(); let logger = StoringLogger::default();
$(logger.put($name.0.release());)*
Ok((logger, ($($name.1,)*), false $(|| $name.2)*))
let mut did_run_any = false;
$(
let (log, artifact, did_run) = $name?;
logger.put(log.release());
did_run_any = did_run_any || did_run;
let $name = artifact;
)*
Ok((logger, ($($name,)*), did_run_any))
} }
} }
); );

Loading…
Cancel
Save