forked from github-starred/komodo
update status enum
This commit is contained in:
@@ -49,7 +49,7 @@ async fn create(
|
||||
target: UpdateTarget::Build(build_id),
|
||||
operation: Operation::CreateBuild,
|
||||
start_ts,
|
||||
end_ts: unix_timestamp_ms() as i64,
|
||||
end_ts: Some(unix_timestamp_ms() as i64),
|
||||
operator: user.id.clone(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ async fn create(
|
||||
target: UpdateTarget::Deployment(deployment_id),
|
||||
operation: Operation::CreateDeployment,
|
||||
start_ts,
|
||||
end_ts: unix_timestamp_ms() as i64,
|
||||
end_ts: Some(unix_timestamp_ms() as i64),
|
||||
operator: user.id.clone(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -83,7 +83,7 @@ async fn create(
|
||||
target: UpdateTarget::Server(server_id),
|
||||
operation: Operation::CreateServer,
|
||||
start_ts,
|
||||
end_ts: unix_timestamp_ms() as i64,
|
||||
end_ts: Some(unix_timestamp_ms() as i64),
|
||||
operator: user.id.clone(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -156,8 +156,8 @@ pub struct Update {
|
||||
pub operation: Operation,
|
||||
pub log: Vec<Log>,
|
||||
pub start_ts: i64,
|
||||
pub end_ts: i64,
|
||||
pub in_progress: bool,
|
||||
pub end_ts: Option<i64>,
|
||||
pub status: UpdateStatus,
|
||||
pub is_error: bool,
|
||||
pub operator: String,
|
||||
}
|
||||
@@ -395,6 +395,21 @@ impl Default for UpdateTarget {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Display, EnumString, PartialEq, Hash, Eq, Clone, Copy)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum UpdateStatus {
|
||||
Queued,
|
||||
InProgress,
|
||||
Complete,
|
||||
}
|
||||
|
||||
impl Default for UpdateStatus {
|
||||
fn default() -> Self {
|
||||
UpdateStatus::Complete
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Display, EnumString, PartialEq, Hash, Eq, Clone, Copy)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
|
||||
Reference in New Issue
Block a user