diff --git a/src/db.rs b/src/db.rs index db15769..5697119 100644 --- a/src/db.rs +++ b/src/db.rs @@ -76,6 +76,7 @@ pub fn build_pool( .test_on_check_out(true) // no noticeable performance hit .min_idle(Some(min_size)) .max_size(max_size) + .max_lifetime(Some(Duration::from_secs(60))) .build(manager) .unwrap(); info!( diff --git a/src/server.rs b/src/server.rs index 47a2be3..10d98ca 100644 --- a/src/server.rs +++ b/src/server.rs @@ -637,7 +637,7 @@ async fn nostr_server( if let Some(previous_query) = running_queries.insert(s.id.to_owned(), abandon_query_tx) { previous_query.send(()).ok(); } - // start a database query + // start a database query. this spawns a blocking database query on a worker thread. db::db_query(s, cid.to_owned(), pool.clone(), query_tx.clone(), abandon_query_rx).await; }, Err(e) => {