Do some connection pooling.

This prevents exhaustion of connections and also
has some performance benefits.
This commit is contained in:
2026-05-01 21:29:04 +01:00
parent aae997fc41
commit 13b82d66c6
4 changed files with 83 additions and 18 deletions

21
Cargo.lock generated
View File

@@ -1185,6 +1185,7 @@ dependencies = [
"downcast-rs",
"itoa",
"pq-sys",
"r2d2",
]
[[package]]
@@ -2652,6 +2653,17 @@ version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "r2d2"
version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93"
dependencies = [
"log",
"parking_lot",
"scheduled-thread-pool",
]
[[package]]
name = "rand"
version = "0.9.4"
@@ -2994,6 +3006,15 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "scheduled-thread-pool"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19"
dependencies = [
"parking_lot",
]
[[package]]
name = "scopeguard"
version = "1.2.0"