fix: correctly log SQL generation time

This commit is contained in:
Greg Heartsfield 2023-02-03 10:39:41 -06:00
parent 5999009779
commit cdd4e5949f

View File

@ -364,9 +364,8 @@ impl NostrRepo for SqliteRepo {
for filter in sub.filters.iter() { for filter in sub.filters.iter() {
let filter_start = Instant::now(); let filter_start = Instant::now();
filter_count += 1; filter_count += 1;
let (q, p, idx) = query_from_filter(&filter);
let sql_gen_elapsed = start.elapsed(); let sql_gen_elapsed = start.elapsed();
let (q, p, idx) = query_from_filter(&filter);
if sql_gen_elapsed > Duration::from_millis(10) { if sql_gen_elapsed > Duration::from_millis(10) {
debug!("SQL (slow) generated in {:?}", filter_start.elapsed()); debug!("SQL (slow) generated in {:?}", filter_start.elapsed());
} }