added cross compatiblity between shutdown flag and state entries

This commit is contained in:
2026-01-15 00:22:55 +01:00
parent f4b20f824d
commit 75ab1969c7
14 changed files with 850 additions and 543 deletions

View File

@@ -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?;
}
};
}