fix: use correct start time for logging SQL generation

This commit is contained in:
Greg Heartsfield 2023-02-12 15:00:50 -06:00
parent abc356c17d
commit f44dae6ac9

View File

@ -342,7 +342,7 @@ 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 sql_gen_elapsed = start.elapsed(); let sql_gen_elapsed = filter_start.elapsed();
let (q, p, idx) = query_from_filter(filter); 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());