mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 14:34:19 +00:00
fix: make Pool::try_acquire()
fair only when fair=true
in the options
This commit is contained in:
parent
15e0a5553a
commit
e2c707b447
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ impl<DB: Database> SharedPool<DB> {
|
|||
#[inline]
|
||||
pub(super) fn try_acquire(&self) -> Option<Floating<'_, Live<DB>>> {
|
||||
// don't cut in line
|
||||
if !self.waiters.is_empty() {
|
||||
if self.options.fair && !self.waiters.is_empty() {
|
||||
return None;
|
||||
}
|
||||
Some(self.pop_idle()?.into_live())
|
||||
|
|
Loading…
Reference in a new issue