mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-04 10:35: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 =
|
||||
inner.processing_tasks.read().processed_previously().clone();
|
||||
log::info!("Deleting {} processed tasks", processed.len());
|
||||
for task in processed {
|
||||
let node = format!("/tasks/task-{:0>10?}", task as i32);
|
||||
for task_id in processed {
|
||||
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.
|
||||
.delete(&node, None)
|
||||
.unwrap();
|
||||
s3.delete_object(format!("tasks.{:0>10?}", task_id as u32))
|
||||
.unwrap();
|
||||
// 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