Skip to content

Commit b67c33b

Browse files
authored
Use latest bb8 and use Lifo as the queue strategy in the pool (#455)
* Use git bb8 * Use latest bb8 and change pool is use stack
1 parent a8a30ad commit b67c33b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
tokio = { version = "1", features = ["full"] }
99
bytes = "1"
1010
md-5 = "0.10"
11-
bb8 = "0.8.0"
11+
bb8 = { git = "https://github.com/djc/bb8.git", rev = "ad653e0" } # https://github.com/djc/bb8/commit/ad653e021607eb1f90ed6ce554d1766920308ffa
1212
async-trait = "0.1"
1313
rand = "0.8"
1414
chrono = "0.4"

src/pool.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use arc_swap::ArcSwap;
22
use async_trait::async_trait;
3-
use bb8::{ManageConnection, Pool, PooledConnection};
3+
use bb8::{ManageConnection, Pool, PooledConnection, QueueStrategy};
44
use bytes::{BufMut, BytesMut};
55
use chrono::naive::NaiveDateTime;
66
use log::{debug, error, info, warn};
@@ -401,6 +401,7 @@ impl ConnectionPool {
401401
.idle_timeout(Some(std::time::Duration::from_millis(idle_timeout)))
402402
.max_lifetime(Some(std::time::Duration::from_millis(server_lifetime)))
403403
.reaper_rate(std::time::Duration::from_millis(reaper_rate))
404+
.queue_strategy(QueueStrategy::Lifo)
404405
.test_on_check_out(false);
405406

406407
let pool = if config.general.validate_config {

0 commit comments

Comments
 (0)