added cross compatiblity between shutdown flag and state entries
This commit is contained in:
@@ -7,4 +7,22 @@ macro_rules! check_shutdown {
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// Mark incomplete state on shutdown
|
||||
/// Usage: mark_incomplete_on_shutdown!(&manager, "step_name", content_ref, DataStage::Data, &shutdown_flag)?;
|
||||
#[macro_export]
|
||||
macro_rules! mark_incomplete_on_shutdown {
|
||||
($manager:expr, $step_name:expr, $content_ref:expr, $data_stage:expr, $shutdown_flag:expr) => {
|
||||
if $shutdown_flag.load(std::sync::atomic::Ordering::SeqCst) {
|
||||
$manager
|
||||
.mark_incomplete(
|
||||
$step_name.to_string(),
|
||||
$content_ref,
|
||||
$data_stage,
|
||||
"Incomplete due to shutdown".to_string(),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user