This commit is contained in:
2024-12-24 22:38:24 +01:00
parent ff7a2deaf4
commit 2a44308602
2 changed files with 4 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ use crate::config::CONFIG;
use sqlx::{postgres::PgPoolOptions, PgPool};
pub async fn get_prisma_client() -> PgPool {
pub async fn get_postgres_pool() -> PgPool {
let database_url: String = format!(
"postgresql://{}:{}@{}:{}/{}",
CONFIG.postgres_user,

View File

@@ -7,11 +7,11 @@ use axum::{
};
use axum_prometheus::PrometheusMetricLayer;
use sqlx::PgPool;
use std::sync::Arc;
use tower_http::trace::{self, TraceLayer};
use tracing::Level;
use crate::{config::CONFIG, db::get_prisma_client};
use crate::{config::CONFIG, db::get_postgres_pool};
pub mod donate_notifications;
pub mod languages;
@@ -40,7 +40,7 @@ async fn auth(req: Request<axum::body::Body>, next: Next) -> Result<Response, St
}
pub async fn get_router() -> Router {
let client = Arc::new(get_prisma_client().await);
let client = get_postgres_pool().await;
let (prometheus_layer, metric_handle) = PrometheusMetricLayer::pair();