Skip to content

Commit 4a1b346

Browse files
committed
Make it clear what's happening when cargo run hangs for 10 seconds
I kept hitting this locally and got annoyed.
1 parent 6338388 commit 4a1b346

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/db/pool.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::metrics::Metrics;
22
use crate::Config;
3+
use log::debug;
34
use postgres::{Client, NoTls};
45
use r2d2_postgres::PostgresConnectionManager;
56
use std::sync::Arc;
@@ -20,6 +21,9 @@ pub struct Pool {
2021

2122
impl Pool {
2223
pub fn new(config: &Config, metrics: Arc<Metrics>) -> Result<Pool, PoolError> {
24+
debug!(
25+
"creating database pool (if this hangs, consider running `docker-compose up -d db s3`)"
26+
);
2327
Self::new_inner(config, metrics, DEFAULT_SCHEMA)
2428
}
2529

0 commit comments

Comments
 (0)