Skip to content

Commit

Permalink
decrement pool size when connection is released
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwhitehead committed Dec 13, 2020
1 parent 04647ae commit 9ce95fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sqlx-core/src/pool/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ impl<DB: Database> DerefMut for PoolConnection<DB> {
}

impl<DB: Database> PoolConnection<DB> {
// explicitly release a connection from the pool
/// Explicitly release a connection from the pool
pub fn release(mut self) -> DB::Connection {
DecrementSizeGuard::new(&self.pool);
self.live.take().expect("PoolConnection double-dropped").raw
}
}
Expand Down

0 comments on commit 9ce95fa

Please sign in to comment.