We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
AsyncPgConnection::try_from_client_and_connection()
1 parent 0cac9a2 commit bc7cd0eCopy full SHA for bc7cd0e
src/db.rs
@@ -96,14 +96,7 @@ async fn establish_async_connection(
96
let connector = MakeTlsConnector::new(connector);
97
let result = tokio_postgres::connect(url, connector).await;
98
let (client, conn) = result.map_err(|err| BadConnection(err.to_string()))?;
99
-
100
- tokio::spawn(async move {
101
- if let Err(e) = conn.await {
102
- eprintln!("Database connection: {e}");
103
- }
104
- });
105
106
- AsyncPgConnection::try_from(client).await
+ AsyncPgConnection::try_from_client_and_connection(client, conn).await
107
}
108
109
#[derive(Debug, Clone, Copy)]
0 commit comments