Improve the health route by ensuring lmdb is not down

And refactorize slightly the auth controller.
このコミットが含まれているのは:
Tamo 2023-04-06 13:38:47 +02:00
コミット 4d308d5237
13個のファイルの変更64行の追加26行の削除

ファイルの表示

@ -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,