mirror of
https://github.com/flibusta-apps/users_settings_server.git
synced 2025-12-06 06:35:39 +01:00
Fix
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::config::CONFIG;
|
|||||||
|
|
||||||
use sqlx::{postgres::PgPoolOptions, PgPool};
|
use sqlx::{postgres::PgPoolOptions, PgPool};
|
||||||
|
|
||||||
pub async fn get_prisma_client() -> PgPool {
|
pub async fn get_postgres_pool() -> PgPool {
|
||||||
let database_url: String = format!(
|
let database_url: String = format!(
|
||||||
"postgresql://{}:{}@{}:{}/{}",
|
"postgresql://{}:{}@{}:{}/{}",
|
||||||
CONFIG.postgres_user,
|
CONFIG.postgres_user,
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ use axum::{
|
|||||||
};
|
};
|
||||||
use axum_prometheus::PrometheusMetricLayer;
|
use axum_prometheus::PrometheusMetricLayer;
|
||||||
use sqlx::PgPool;
|
use sqlx::PgPool;
|
||||||
use std::sync::Arc;
|
|
||||||
use tower_http::trace::{self, TraceLayer};
|
use tower_http::trace::{self, TraceLayer};
|
||||||
use tracing::Level;
|
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 donate_notifications;
|
||||||
pub mod languages;
|
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 {
|
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();
|
let (prometheus_layer, metric_handle) = PrometheusMetricLayer::pair();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user