Skip to content

Commit

Permalink
downloader: fix less
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Mar 6, 2024
1 parent d39faeb commit 7a0f68b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions renterd/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (h priorityQueue) Len() int { return len(h) }

func (h priorityQueue) Less(i, j int) bool {
if h[i].priority != h[j].priority {
return h[i].priority < h[j].priority
return h[i].priority > h[j].priority
}
return h[i].timestamp.Before(h[j].timestamp)
}
Expand Down Expand Up @@ -223,8 +223,10 @@ func (bd *BlockDownloader) downloadWorker(ctx context.Context, n int) {
}

task := heap.Pop(bd.queue).(*blockResponse)
log := log.With(zap.Stringer("cid", task.cid), zap.Stringer("priority", task.priority))
log.Debug("popped task from queue")
bd.mu.Unlock()
bd.doDownloadTask(task, log.With(zap.Stringer("cid", task.cid), zap.Stringer("priority", task.priority)))
bd.doDownloadTask(task, log)
}
}

Expand Down

0 comments on commit 7a0f68b

Please sign in to comment.