mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-27 11:32:59 +00:00
fix: make Pool::try_acquire() fair only when fair=true in the options
This commit is contained in:
parent
15e0a5553a
commit
e2c707b447
@ -66,7 +66,7 @@ impl<DB: Database> SharedPool<DB> {
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub(super) fn try_acquire(&self) -> Option<Floating<'_, Live<DB>>> {
|
pub(super) fn try_acquire(&self) -> Option<Floating<'_, Live<DB>>> {
|
||||||
// don't cut in line
|
// don't cut in line
|
||||||
if !self.waiters.is_empty() {
|
if self.options.fair && !self.waiters.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
Some(self.pop_idle()?.into_live())
|
Some(self.pop_idle()?.into_live())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user