move the autobatcher logic to another file

This commit is contained in:
Irevoire 2022-09-09 12:16:19 +02:00 committed by Clément Renault
parent f638774764
commit 448f44f631
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
3 changed files with 289 additions and 302 deletions

View file

@ -1,3 +1,4 @@
mod autobatcher;
mod batch;
mod document_formats;
pub mod error;
@ -219,7 +220,7 @@ impl IndexScheduler {
continue;
}
};
let mut batch = match self.get_next_batch(&wtxn) {
let mut batch = match self.create_next_batch(&wtxn) {
Ok(batch) => batch,
Err(e) => {
log::error!("{}", e);
@ -227,7 +228,7 @@ impl IndexScheduler {
}
};
let res = self.process_batch(&mut wtxn, &mut batch);
let res = self.process_batch(&mut wtxn, batch);
// TODO: TAMO: do this later
// must delete the file on disk
@ -245,6 +246,7 @@ impl IndexScheduler {
}
}
#[cfg(truc)]
fn process_batch(&self, wtxn: &mut RwTxn, batch: &mut Batch) -> Result<()> {
match batch {
Batch::One(task) => match &task.kind {