Merge pull request #5565 from meilisearch/fix-0-batched-task

Fix 0 batched task
This commit is contained in:
Tamo 2025-05-15 12:41:48 +00:00 committed by GitHub
commit cc2011a27f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 153 additions and 0 deletions

View file

@ -383,6 +383,11 @@ impl IndexScheduler {
/// This function will execute in a different thread and must be called
/// only once per index scheduler.
fn run(&self) {
// If the number of batched tasks is 0, we don't need to run the scheduler at all.
// It will never be able to process any tasks.
if self.scheduler.max_number_of_batched_tasks == 0 {
return;
}
let run = self.private_clone();
std::thread::Builder::new()
.name(String::from("scheduler"))