[BE] Log number of active/idle connections to investigate #37
This commit is contained in:
parent
bc671ea789
commit
ad20a991e0
@ -51,7 +51,12 @@ pub async fn db() -> Result<&'static Pool<MySql>, String> {
|
|||||||
|
|
||||||
for _ in 0..attempts {
|
for _ in 0..attempts {
|
||||||
match DB.get() {
|
match DB.get() {
|
||||||
Some(db) => return Ok(db),
|
Some(db) => {
|
||||||
|
log::info!("DB active connections: {}", db.size());
|
||||||
|
log::info!("DB num_idle connections: {}", db.num_idle());
|
||||||
|
|
||||||
|
return Ok(db)
|
||||||
|
},
|
||||||
None => {
|
None => {
|
||||||
log::info!("DB not initialized, initializing from db()");
|
log::info!("DB not initialized, initializing from db()");
|
||||||
let _ = init_db().await;
|
let _ = init_db().await;
|
||||||
|
Loading…
Reference in New Issue
Block a user