Make it compile

This commit is contained in:
Louis Dureuil 2025-04-02 17:14:40 +02:00
parent 87547550f5
commit f3ab940776
No known key found for this signature in database
6 changed files with 36 additions and 27 deletions

View file

@ -21,6 +21,8 @@ pub struct BatchView {
pub started_at: OffsetDateTime,
#[serde(with = "time::serde::rfc3339::option", default)]
pub finished_at: Option<OffsetDateTime>,
#[serde(default = "meilisearch_types::batches::default_stop_reason")]
pub stop_reason: String,
}
impl BatchView {
@ -33,6 +35,7 @@ impl BatchView {
duration: batch.finished_at.map(|finished_at| finished_at - batch.started_at),
started_at: batch.started_at,
finished_at: batch.finished_at,
stop_reason: batch.stop_reason.clone(),
}
}
}

View file

@ -32,7 +32,7 @@ pub struct Batch {
pub stop_reason: String,
}
fn default_stop_reason() -> String {
pub fn default_stop_reason() -> String {
BatchStopReason::default().to_string()
}

View file

@ -691,8 +691,8 @@ pub enum BatchStopReason {
task_limit: usize,
},
ReachedSizeLimit {
size_limit: usize,
size: usize,
size_limit: u64,
size: u64,
},
PrimaryKeyIndexMismatch {
id: TaskId,