mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Rename pending into enqueued
This commit is contained in:
parent
0344cf5874
commit
cb23775d18
3 changed files with 14 additions and 14 deletions
|
@ -4,14 +4,14 @@ use uuid::Uuid;
|
|||
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Pending<M> {
|
||||
pub struct Enqueued<M> {
|
||||
pub update_id: u64,
|
||||
pub meta: M,
|
||||
pub enqueued_at: DateTime<Utc>,
|
||||
pub index_uuid: Uuid,
|
||||
}
|
||||
|
||||
impl<M> Pending<M> {
|
||||
impl<M> Enqueued<M> {
|
||||
pub fn new(meta: M, update_id: u64, index_uuid: Uuid) -> Self {
|
||||
Self {
|
||||
enqueued_at: Utc::now(),
|
||||
|
@ -63,7 +63,7 @@ impl<M, N> Processed<M, N> {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Processing<M> {
|
||||
#[serde(flatten)]
|
||||
pub from: Pending<M>,
|
||||
pub from: Enqueued<M>,
|
||||
pub started_processing_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ impl<M> Processing<M> {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Aborted<M> {
|
||||
#[serde(flatten)]
|
||||
from: Pending<M>,
|
||||
from: Enqueued<M>,
|
||||
aborted_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ impl<M, E> Failed<M, E> {
|
|||
#[serde(tag = "status", rename_all = "camelCase")]
|
||||
pub enum UpdateStatus<M, N, E> {
|
||||
Processing(Processing<M>),
|
||||
Pending(Pending<M>),
|
||||
Enqueued(Enqueued<M>),
|
||||
Processed(Processed<M, N>),
|
||||
Aborted(Aborted<M>),
|
||||
Failed(Failed<M, E>),
|
||||
|
@ -140,7 +140,7 @@ impl<M, N, E> UpdateStatus<M, N, E> {
|
|||
pub fn id(&self) -> u64 {
|
||||
match self {
|
||||
UpdateStatus::Processing(u) => u.id(),
|
||||
UpdateStatus::Pending(u) => u.id(),
|
||||
UpdateStatus::Enqueued(u) => u.id(),
|
||||
UpdateStatus::Processed(u) => u.id(),
|
||||
UpdateStatus::Aborted(u) => u.id(),
|
||||
UpdateStatus::Failed(u) => u.id(),
|
||||
|
@ -155,9 +155,9 @@ impl<M, N, E> UpdateStatus<M, N, E> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<M, N, E> From<Pending<M>> for UpdateStatus<M, N, E> {
|
||||
fn from(other: Pending<M>) -> Self {
|
||||
Self::Pending(other)
|
||||
impl<M, N, E> From<Enqueued<M>> for UpdateStatus<M, N, E> {
|
||||
fn from(other: Enqueued<M>) -> Self {
|
||||
Self::Enqueued(other)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue