From 71b296141ed278d9a808689aad0444324fe37cb6 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Tue, 6 May 2025 14:58:23 -0400 Subject: [PATCH] Avoid calling get-entries when range is invalid (end < begin) end < begin can arise if we've rounded down end to avoid downloading a partial tile, but the log position is already within the partial tile (which can happen with a brand new log and -start_at_end). --- monitor/monitor.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/monitor/monitor.go b/monitor/monitor.go index 8b8cbd4..6d4f070 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -418,11 +418,13 @@ func downloadWorker(ctx context.Context, config *Config, ctlog *loglist.Log, cli case batch = <-batchesIn: } - entries, err := getEntriesFull(ctx, client, batch.begin, batch.end) - if err != nil { - return err + if batch.end > batch.begin { + entries, err := getEntriesFull(ctx, client, batch.begin, batch.end) + if err != nil { + return err + } + batch.entries = entries } - batch.entries = entries select { case <-ctx.Done():