mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-12-02 01:55:03 +08:00
Add the canceled task status
This commit is contained in:
parent
703ba7a1fb
commit
f177c97671
@ -271,6 +271,7 @@ pub enum Status {
|
|||||||
Processing,
|
Processing,
|
||||||
Succeeded,
|
Succeeded,
|
||||||
Failed,
|
Failed,
|
||||||
|
Canceled,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for Status {
|
impl Display for Status {
|
||||||
@ -280,6 +281,7 @@ impl Display for Status {
|
|||||||
Status::Processing => write!(f, "processing"),
|
Status::Processing => write!(f, "processing"),
|
||||||
Status::Succeeded => write!(f, "succeeded"),
|
Status::Succeeded => write!(f, "succeeded"),
|
||||||
Status::Failed => write!(f, "failed"),
|
Status::Failed => write!(f, "failed"),
|
||||||
|
Status::Canceled => write!(f, "canceled"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -296,6 +298,8 @@ impl FromStr for Status {
|
|||||||
Ok(Status::Succeeded)
|
Ok(Status::Succeeded)
|
||||||
} else if status.eq_ignore_ascii_case("failed") {
|
} else if status.eq_ignore_ascii_case("failed") {
|
||||||
Ok(Status::Failed)
|
Ok(Status::Failed)
|
||||||
|
} else if status.eq_ignore_ascii_case("canceled") {
|
||||||
|
Ok(Status::Canceled)
|
||||||
} else {
|
} else {
|
||||||
Err(ResponseError::from_msg(
|
Err(ResponseError::from_msg(
|
||||||
format!(
|
format!(
|
||||||
|
Loading…
Reference in New Issue
Block a user