omit last unused span

main
Bel LaPointe 2025-10-03 11:38:59 -06:00
parent fee1bad5e8
commit 081953776b
1 changed files with 5 additions and 1 deletions

View File

@ -73,7 +73,11 @@ func poll(ctx context.Context, client *valkey.Client) Poll {
waitSuccess(ctx, client, func(s string) {
writes = append(writes, s)
})
spans = append(spans, [2]time.Time{time.Now(), time.Now()})
now := time.Now()
spans = append(spans, [2]time.Time{now, now})
}
if last := spans[len(spans)-1]; last[1] == last[0] {
spans = spans[:len(spans)-1]
}
return Poll{Spans: spans, Writes: writes}
}