mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +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]
|
||||
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…
x
Reference in New Issue
Block a user