You've already forked AstralRinth
forked from didirus/AstralRinth
* reduced the default, and added environment override. * Using parse is more stable and doesn't fail CI this time :P * Added support for monitoring This support is currently basic, but it can be improved later down the road. * Forgot scheduler file * Added health check * Cargo fix * Update cargo.lock to avoid action fails. Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
16 lines
386 B
Rust
16 lines
386 B
Rust
use sqlx::{PgPool};
|
|
use actix_web::web;
|
|
|
|
pub async fn test_database(postgres: web::Data<PgPool>) -> Result<(), sqlx::Error> {
|
|
let mut transaction = postgres.acquire().await?;
|
|
let result = sqlx::query(
|
|
"
|
|
SELECT 1
|
|
"
|
|
).execute(&mut transaction)
|
|
.await;
|
|
match result {
|
|
Ok(_) => Ok(()),
|
|
Err(e) => Err(e)
|
|
}
|
|
} |