log when meilisearch need to delete tasks

This commit is contained in:
Tamo 2023-04-25 13:11:58 +02:00 committed by Louis Dureuil
parent f9ddd32545
commit 972bb2831c
No known key found for this signature in database

View File

@ -1115,10 +1115,16 @@ impl IndexScheduler {
// /!\ the len must be at least 2 or else we might enter an infinite loop where we only delete
// the deletion tasks we enqueued ourselves.
if to_delete.len() < 2 {
log::warn!("The task queue is almost full, but no task can be deleted yet.");
// the only thing we can do is hope that the user tasks are going to finish
return Ok(());
}
log::info!(
"The task queue is almost full. Thus, meilisearch will delete the last {} finished tasks.",
to_delete.len()
);
self.register(KindWithContent::TaskDeletion {
query: format!(
"?from={},limit={},status=succeeded,failed,canceled",