mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-03-30 13:18:58 +03:00
feat: move health endpoint to use ping from db_*
This commit is contained in:
parent
79506a93b9
commit
f337721b25
1 changed files with 1 additions and 6 deletions
|
@ -76,14 +76,9 @@ async fn health(data: AppData) -> impl Responder {
|
||||||
use sqlx::Connection;
|
use sqlx::Connection;
|
||||||
|
|
||||||
let mut resp_builder = HealthBuilder::default();
|
let mut resp_builder = HealthBuilder::default();
|
||||||
resp_builder.db(false);
|
|
||||||
resp_builder.redis = None;
|
resp_builder.redis = None;
|
||||||
|
|
||||||
if let Ok(mut con) = data.db.acquire().await {
|
resp_builder.db(data.dblib.ping().await);
|
||||||
if con.ping().await.is_ok() {
|
|
||||||
resp_builder.db(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if let SystemGroup::Redis(_) = data.captcha {
|
if let SystemGroup::Redis(_) = data.captcha {
|
||||||
if let Ok(r) = Redis::new(RedisConfig::Single(
|
if let Ok(r) = Redis::new(RedisConfig::Single(
|
||||||
|
|
Loading…
Add table
Reference in a new issue