mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-02-01 14:26:44 -06:00
refactor: consolidate HTTP client for TCP/Unix socket handling
Extract reqwest client creation into dedicated HttpClient abstraction that handles both TCP and Unix socket connections transparently. Simplifies proxy logic by removing duplicate URL construction and client selection throughout the codebase.
This commit is contained in:
+2
-2
@@ -7,7 +7,7 @@ pub use projects::*;
|
||||
pub use settings::*;
|
||||
pub use tags::*;
|
||||
|
||||
use sqlx::{PgPool, postgres::PgPoolOptions};
|
||||
use sqlx::{PgPool, postgres::PgPoolOptions, query};
|
||||
|
||||
/// Database connection pool creation
|
||||
pub async fn create_pool(database_url: &str) -> Result<PgPool, sqlx::Error> {
|
||||
@@ -20,7 +20,7 @@ pub async fn create_pool(database_url: &str) -> Result<PgPool, sqlx::Error> {
|
||||
|
||||
/// Health check query
|
||||
pub async fn health_check(pool: &PgPool) -> Result<(), sqlx::Error> {
|
||||
sqlx::query!("SELECT 1 as check")
|
||||
query!("SELECT 1 as check")
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map(|_| ())
|
||||
|
||||
Reference in New Issue
Block a user