config: add an option to set pool size manually

Signed-off-by: SphericalKat <amolele@gmail.com>
This commit is contained in:
sphericalkat committed 2020-11-23 00:29:39 +05:30
1 parent 3d2c8db5ba
commit a0642019c2
1 file changed
+2 -1
+2 -1
View File
@@ -7,7 +7,8 @@ pub type Pool = r2d2::Pool<ConnectionManager<PgConnection>>;
pub fn pool() -> Pool {
let manager = ConnectionManager::<PgConnection>::new(database_url());
Pool::builder().max_size(15).build(manager).unwrap()
let pool_size = env::var("KATBIN_POOL_SIZE").unwrap().parse::<u32>().expect("pool size");
Pool::builder().max_size(pool_size).build(manager).unwrap()
}
fn database_url() -> String {