feat: move health endpoint to use ping from db_*

This commit is contained in:
realaravinth 2022-05-10 23:00:54 +05:30
parent 79506a93b9
commit f337721b25
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88

View file

@ -76,14 +76,9 @@ async fn health(data: AppData) -> impl Responder {
use sqlx::Connection;
let mut resp_builder = HealthBuilder::default();
resp_builder.db(false);
resp_builder.redis = None;
if let Ok(mut con) = data.db.acquire().await {
if con.ping().await.is_ok() {
resp_builder.db(true);
}
};
resp_builder.db(data.dblib.ping().await);
if let SystemGroup::Redis(_) = data.captcha {
if let Ok(r) = Redis::new(RedisConfig::Single(