Skip to content

Commit

Permalink
downlaoder: always log errors
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Mar 11, 2024
1 parent d0e535b commit bef6483
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions renterd/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
lru "github.com/hashicorp/golang-lru/v2"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
format "github.com/ipfs/go-ipld-format"
mh "github.com/multiformats/go-multihash"
"go.sia.tech/renterd/api"
"go.sia.tech/renterd/worker"
Expand Down Expand Up @@ -139,9 +138,7 @@ func (bd *BlockDownloader) doDownloadTask(task *blockResponse, log *zap.Logger)
start := time.Now()
bucket, key, err := bd.store.BlockLocation(task.cid)
if err != nil {
if !format.IsNotFound(err) {
log.Error("failed to get block location", zap.Error(err))
}
log.Error("failed to get block location", zap.Error(err))
task.err = err
bd.cache.Remove(cidKey(task.cid))
close(task.ch)
Expand All @@ -155,9 +152,7 @@ func (bd *BlockDownloader) doDownloadTask(task *blockResponse, log *zap.Logger)

err = bd.workerClient.DownloadObject(ctx, blockBuf, bucket, key, api.DownloadObjectOptions{})
if err != nil {
if !format.IsNotFound(err) {
log.Error("failed to download block", zap.Error(err))
}
log.Error("failed to download block", zap.Error(err))
task.err = err
bd.cache.Remove(cidKey(task.cid))
close(task.ch)
Expand Down

0 comments on commit bef6483

Please sign in to comment.