v0.3.7-pre.010
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-app-backfill-desk/src/app_state.rs
|
||||
// version: 7
|
||||
// version: 8
|
||||
|
||||
//! Shared backend state owned by the Backfill Desk Tauri application.
|
||||
|
||||
@@ -123,7 +123,7 @@ impl crate::AppState {
|
||||
application_version: env!("CARGO_PKG_VERSION").to_owned(),
|
||||
config_document_count: document_count,
|
||||
fallback_logging_active: runtime.fallback_active,
|
||||
shell_phase: "pre.008-runtime-start".to_owned(),
|
||||
shell_phase: "pre.010-cancel-races".to_owned(),
|
||||
startup_diagnostic: runtime.startup_diagnostic.clone(),
|
||||
});
|
||||
}
|
||||
@@ -277,6 +277,29 @@ impl crate::AppState {
|
||||
};
|
||||
}
|
||||
|
||||
/// Requests cooperative cancellation of one exact backend-issued Backfill Job identity.
|
||||
pub(crate) fn cancel_backfill(&self, job_id: &str) -> ksp_core_lib::Result<crate::BackfillCancelResponseDto> {
|
||||
let cancelled = self.backfill_runs.cancel(job_id);
|
||||
let cancelled = match cancelled {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
ksp_logging_lib::debug!(
|
||||
target: crate::TRACING_TARGET,
|
||||
domain = crate::TRACING_DOMAIN_RUN,
|
||||
accepted = cancelled.accepted,
|
||||
job_id = cancelled.job_id.as_str(),
|
||||
state = cancelled.state.as_str(),
|
||||
"processed Backfill Desk cooperative cancellation request"
|
||||
);
|
||||
return std::result::Result::Ok(cancelled);
|
||||
}
|
||||
|
||||
/// Requests best-effort cooperative cancellation of the active run during application shutdown.
|
||||
pub(crate) fn cancel_active_backfill_for_shutdown(&self) -> ksp_core_lib::Result<bool> {
|
||||
return self.backfill_runs.cancel_active_for_shutdown();
|
||||
}
|
||||
|
||||
/// Executes one already-admitted Backfill launch and restores application resources after its terminal result.
|
||||
pub(crate) async fn execute_backfill_run(&self, launch: crate::BackfillRunLaunch) -> ksp_core_lib::Result<()> {
|
||||
let job_id = launch.job_id.clone();
|
||||
|
||||
Reference in New Issue
Block a user