A bit faster get_pool (#187)

* A bit faster get_pool

* fmt
This commit is contained in:
Mostafa Abdelraouf
2022-10-08 10:16:04 -05:00
committed by GitHub
parent 3d33ccf4b0
commit 83fd639918

View File

@@ -633,7 +633,7 @@ impl ManageConnection for ServerPool {
/// Get the connection pool
pub fn get_pool(db: &str, user: &str) -> Option<ConnectionPool> {
match get_all_pools().get(&PoolIdentifier::new(&db, &user)) {
match (*(*POOLS.load())).get(&PoolIdentifier::new(db, user)) {
Some(pool) => Some(pool.clone()),
None => None,
}