implement cancel build

This commit is contained in:
mbecker20
2023-07-13 08:24:47 +00:00
parent e2a76274ef
commit 4cd074ee2a
11 changed files with 269 additions and 224 deletions

View File

@@ -42,6 +42,10 @@ impl Update {
self.logs.push(Log::error(stage, msg));
}
pub fn in_progress(&mut self) {
self.status = UpdateStatus::InProgress;
}
pub fn finalize(&mut self) {
self.success = all_logs_success(&self.logs);
self.end_ts = Some(monitor_timestamp());

View File

@@ -12,3 +12,16 @@ use crate::entities::update::Update;
pub struct RunBuild {
pub build_id: String,
}
//
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Request)]
#[response(CancelBuildResponse)]
pub struct CancelBuild {
pub build_id: String,
}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CancelBuildResponse {}