mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-05 02:55:46 +01:00
Remove tasks and content file on the s3
This commit is contained in:
parent
c158d03337
commit
f544cfa444
@ -721,12 +721,22 @@ impl IndexScheduler {
|
|||||||
let processed =
|
let processed =
|
||||||
inner.processing_tasks.read().processed_previously().clone();
|
inner.processing_tasks.read().processed_previously().clone();
|
||||||
log::info!("Deleting {} processed tasks", processed.len());
|
log::info!("Deleting {} processed tasks", processed.len());
|
||||||
for task in processed {
|
for task_id in processed {
|
||||||
let node = format!("/tasks/task-{:0>10?}", task as i32);
|
let node = format!("/tasks/task-{:0>10?}", task_id as i32);
|
||||||
let _ = zookeeper // we don't want to crash if we can't delete an update file.
|
let _ = zookeeper // we don't want to crash if we can't delete an update file.
|
||||||
.delete(&node, None)
|
.delete(&node, None)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
s3.delete_object(format!("tasks.{:0>10?}", task_id as u32))
|
||||||
|
.unwrap();
|
||||||
// TODO: Delete the update files associated with the deleted tasks
|
// TODO: Delete the update files associated with the deleted tasks
|
||||||
|
if let Some(content_uuid) = inner
|
||||||
|
.get_task(&rtxn, task_id)
|
||||||
|
.unwrap()
|
||||||
|
.and_then(|t| t.content_uuid())
|
||||||
|
{
|
||||||
|
s3.delete_object(format!("/update-files/{content_uuid}"))
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user