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

@ -82,7 +82,7 @@ impl Server {
> {
actix_web::test::init_service(create_app(
self.service.index_scheduler.clone().into(),
self.service.auth.clone(),
self.service.auth.clone().into(),
self.service.options.clone(),
analytics::MockAnalytics::new(&self.service.options),
true,

View file

@ -13,7 +13,7 @@ use crate::common::encoder::Encoder;
pub struct Service {
pub index_scheduler: Arc<IndexScheduler>,
pub auth: AuthController,
pub auth: Arc<AuthController>,
pub options: Opt,
pub api_key: Option<String>,
}
@ -107,7 +107,7 @@ impl Service {
pub async fn request(&self, mut req: test::TestRequest) -> (Value, StatusCode) {
let app = test::init_service(create_app(
self.index_scheduler.clone().into(),
self.auth.clone(),
self.auth.clone().into(),
self.options.clone(),
analytics::MockAnalytics::new(&self.options),
true,