From d95df3a46f8883398a82b7675c7d8e5a3485cb69 Mon Sep 17 00:00:00 2001
From: dullbananas <dull.bananas0@gmail.com>
Date: Mon, 27 Nov 2023 02:31:19 -0700
Subject: [PATCH] Update diesel-async (#4203)

* Update diesel-async

* Fix
---
 Cargo.toml                    | 2 +-
 crates/db_schema/src/utils.rs | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index fbba47c91..f8178b336 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -99,7 +99,7 @@ activitypub_federation = { version = "0.5.0-beta.5", default-features = false, f
 ] }
 diesel = "2.1.4"
 diesel_migrations = "2.1.0"
-diesel-async = "0.3.2"
+diesel-async = "0.4.1"
 serde = { version = "1.0.193", features = ["derive"] }
 serde_with = "3.4.0"
 actix-web = { version = "4.4.0", default-features = false, features = [
diff --git a/crates/db_schema/src/utils.rs b/crates/db_schema/src/utils.rs
index 594c93629..9ac2d4c88 100644
--- a/crates/db_schema/src/utils.rs
+++ b/crates/db_schema/src/utils.rs
@@ -24,6 +24,7 @@ use diesel_async::{
   pooled_connection::{
     deadpool::{Object as PooledConnection, Pool},
     AsyncDieselConnectionManager,
+    ManagerConfig,
   },
 };
 use diesel_migrations::EmbeddedMigrations;
@@ -291,7 +292,9 @@ pub async fn build_db_pool() -> Result<ActualDbPool, LemmyError> {
   let manager = if tls_enabled {
     // diesel-async does not support any TLS connections out of the box, so we need to manually
     // provide a setup function which handles creating the connection
-    AsyncDieselConnectionManager::<AsyncPgConnection>::new_with_setup(&db_url, establish_connection)
+    let mut config = ManagerConfig::default();
+    config.custom_setup = Box::new(establish_connection);
+    AsyncDieselConnectionManager::<AsyncPgConnection>::new_with_config(&db_url, config)
   } else {
     AsyncDieselConnectionManager::<AsyncPgConnection>::new(&db_url)
   };
-- 
GitLab