Skip to content

Commit c2784eb

Browse files
committed
fix(pool): use the correct method in try_min_connections
1 parent e43e184 commit c2784eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sqlx-core/src/pool/inner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ impl<DB: Database> PoolInner<DB> {
239239

240240
/// Try to maintain `min_connections`, returning any errors (including `PoolTimedOut`).
241241
pub async fn try_min_connections(self: &Arc<Self>, deadline: Instant) -> Result<(), Error> {
242-
crate::rt::timeout_at(deadline, async {
242+
rt::timeout_at(deadline, async {
243243
while self.size() < self.options.min_connections {
244244
// Don't wait for a connect permit.
245245
//
246246
// If no extra permits are available then we shouldn't be trying to spin up
247247
// connections anyway.
248-
let Some((id, permit)) = self.counter.acquire_permit(self).now_or_never() else {
248+
let Some((id, permit)) = self.counter.try_acquire_permit(self) else {
249249
return Ok(());
250250
};
251251

0 commit comments

Comments
 (0)