fix: ensure startup SQL runs, even with zero min writers

This commit is contained in:
Greg Heartsfield 2023-06-23 10:38:06 -05:00
parent 4647476622
commit 087b68128f

View File

@ -1203,6 +1203,11 @@ pub fn build_pool(
.max_lifetime(Some(Duration::from_secs(30))) .max_lifetime(Some(Duration::from_secs(30)))
.build(manager) .build(manager)
.unwrap(); .unwrap();
// retrieve a connection to ensure the startup statements run immediately
{
let _ = pool.get();
}
info!( info!(
"Built a connection pool {:?} (min={}, max={})", "Built a connection pool {:?} (min={}, max={})",
name, min_size, max_size name, min_size, max_size