mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-09 21:29:06 -05:00
refactor: reduce level of some common DB logs
This commit is contained in:
parent
9db5a26b9c
commit
9dd4571bee
|
@ -577,7 +577,7 @@ fn query_from_sub(sub: &Subscription) -> (String, Vec<Box<dyn ToSql>>) {
|
||||||
.map(|s| format!("SELECT content, created_at FROM ({})", s))
|
.map(|s| format!("SELECT content, created_at FROM ({})", s))
|
||||||
.collect();
|
.collect();
|
||||||
let query: String = subqueries_selects.join(" UNION ");
|
let query: String = subqueries_selects.join(" UNION ");
|
||||||
debug!("final query string: {}", query);
|
trace!("final query string: {}", query);
|
||||||
(query, params)
|
(query, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -595,12 +595,12 @@ pub async fn db_query(
|
||||||
mut abandon_query_rx: tokio::sync::oneshot::Receiver<()>,
|
mut abandon_query_rx: tokio::sync::oneshot::Receiver<()>,
|
||||||
) {
|
) {
|
||||||
task::spawn_blocking(move || {
|
task::spawn_blocking(move || {
|
||||||
debug!("going to query for: {:?}", sub);
|
trace!("going to query for: {:?}", sub);
|
||||||
let mut row_count: usize = 0;
|
let mut row_count: usize = 0;
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
// generate SQL query
|
// generate SQL query
|
||||||
let (q, p) = query_from_sub(&sub);
|
let (q, p) = query_from_sub(&sub);
|
||||||
debug!("SQL generated in {:?}", start.elapsed());
|
trace!("SQL generated in {:?}", start.elapsed());
|
||||||
// show pool stats
|
// show pool stats
|
||||||
debug!("DB pool stats: {:?}", pool.state());
|
debug!("DB pool stats: {:?}", pool.state());
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user