From ea204761c9784cf84a1513b5a4f831865c22a553 Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Tue, 20 Dec 2022 15:41:50 -0600 Subject: [PATCH] fix: do not show slow queries more than once per sub --- src/db.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.rs b/src/db.rs index 23e46ba..2aca369 100644 --- a/src/db.rs +++ b/src/db.rs @@ -705,7 +705,7 @@ pub async fn db_query( } // logging for slow queries; show sub and SQL. // to reduce logging; only show 1/16th of clients (leading 0) - if slow_first_event && client_id.starts_with("00") { + if row_count == 0 && slow_first_event && client_id.starts_with("0") { debug!( "query req (slow): {:?} (cid: {}, sub: {:?})", sub, client_id, sub.id