Skip to content

Commit dfae48a

Browse files
authored
Merge pull request #174 from samply/feature/sql-conn-log
log sql conn established
2 parents f316288 + c355b25 commit dfae48a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,19 @@ async fn get_db_pool() -> Result<Option<DbPool>,ExitCode> {
132132

133133
#[cfg(feature = "query-sql")]
134134
async fn get_db_pool() -> Result<Option<DbPool>,ExitCode> {
135+
use tracing::info;
136+
135137
if let Some(connection_string) = CONFIG.postgres_connection_string.clone() {
136138
match db::get_pg_connection_pool(&connection_string, CONFIG.max_db_attempts).await {
137139
Err(e) => {
138140
error!("Error connecting to database: {}", e);
139141
Err(ExitCode::from(8))
140142
}
141-
Ok(pool) => Ok(Some(pool)),
143+
144+
Ok(pool) => {
145+
info!("Postgresql connection established");
146+
Ok(Some(pool))
147+
}
142148
}
143149
} else {
144150
Ok(None)

0 commit comments

Comments
 (0)