Improve the health route by ensuring lmdb is not down

And refactorize slightly the auth controller.
This commit is contained in:
Tamo 2023-04-06 13:38:47 +02:00
parent b4c01581cd
commit 4d308d5237
13 changed files with 64 additions and 26 deletions

View file

@ -429,6 +429,13 @@ impl IndexScheduler {
Ok(this)
}
/// Return `Ok(())` if the index scheduler is able to access one of its database.
pub fn health(&self) -> Result<()> {
let rtxn = self.env.read_txn()?;
self.all_tasks.first(&rtxn)?;
Ok(())
}
fn index_budget(
tasks_path: &Path,
base_map_size: usize,