Skip to content

Commit

Permalink
fix Send bound of Pool::get (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
fakeshadow authored Oct 6, 2024
1 parent 8cc0757 commit 7fd0472
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion postgres/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ impl Pool {
/// return as [`Error`]
pub async fn get(&self) -> Result<PoolConnection<'_>, Error> {
let _permit = self.permits.acquire().await.expect("Semaphore must not be closed");
let conn = match self.conn.lock().unwrap().pop_front() {
let conn = self.conn.lock().unwrap().pop_front();
let conn = match conn {
Some(conn) if !conn.client.closed() => conn,
_ => self.connect().await?,
};
Expand Down

0 comments on commit 7fd0472

Please sign in to comment.