mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Let the tick function set the Failed status itself
This commit is contained in:
parent
566c15fb74
commit
b24b13b036
2 changed files with 25 additions and 42 deletions
|
@ -17,6 +17,7 @@ use std::path::PathBuf;
|
|||
use std::sync::{Arc, RwLock};
|
||||
|
||||
use file_store::{File, FileStore};
|
||||
use meilisearch_types::error::ResponseError;
|
||||
use roaring::RoaringBitmap;
|
||||
use serde::Deserialize;
|
||||
use synchronoise::SignalEvent;
|
||||
|
@ -407,14 +408,14 @@ impl IndexScheduler {
|
|||
}
|
||||
}
|
||||
// In case of a failure we must get back and patch all the tasks with the error.
|
||||
Err(_err) => {
|
||||
Err(err) => {
|
||||
let error: ResponseError = err.into();
|
||||
for id in ids {
|
||||
let mut task = self.get_task(&wtxn, id)?.ok_or(Error::CorruptedTaskQueue)?;
|
||||
task.started_at = Some(started_at);
|
||||
task.finished_at = Some(finished_at);
|
||||
task.status = Status::Failed;
|
||||
// TODO: TAMO: set the error correctly
|
||||
// task.error = Some(err);
|
||||
task.error = Some(error.clone());
|
||||
|
||||
self.update_task(&mut wtxn, &task)?;
|
||||
task.remove_data()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue