polish the global structure of the batch creation

This commit is contained in:
Tamo 2022-09-13 11:46:07 +02:00 committed by Clément Renault
parent 448f44f631
commit b3c9b128d9
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
3 changed files with 179 additions and 60 deletions

View file

@ -221,15 +221,21 @@ impl IndexScheduler {
}
};
let mut batch = match self.create_next_batch(&wtxn) {
Ok(batch) => batch,
Ok(Some(batch)) => batch,
Ok(None) => continue,
Err(e) => {
log::error!("{}", e);
continue;
}
};
// 1. store the starting date with the bitmap of processing tasks
// 2. update the tasks with a starting date *but* do not write anything on disk
// 3. process the tasks
let res = self.process_batch(&mut wtxn, batch);
// 4. store the updated tasks on disk
// TODO: TAMO: do this later
// must delete the file on disk
// in case of error, must update the tasks with the error