introduce a trait to upgrade the indexes

This commit is contained in:
Tamo 2025-01-23 10:50:16 +01:00 committed by Louis Dureuil
parent fd5649091d
commit c27c923439
No known key found for this signature in database
4 changed files with 104 additions and 46 deletions

View file

@ -316,7 +316,10 @@ impl IndexScheduler {
Ok(vec![task])
}
Batch::UpgradeDatabase { mut tasks } => {
let ret = catch_unwind(AssertUnwindSafe(|| self.process_upgrade(progress)));
let KindWithContent::UpgradeDatabase { from } = tasks.last().unwrap().kind else {
unreachable!();
};
let ret = catch_unwind(AssertUnwindSafe(|| self.process_upgrade(from, progress)));
match ret {
Ok(Ok(())) => (),
Ok(Err(e)) => return Err(Error::DatabaseUpgrade(Box::new(e))),