Skip to content

Commit

Permalink
bucket: handle instances where no blocks are loaded
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Colvin <[email protected]>
  • Loading branch information
jacobcolvin-8451 committed Mar 17, 2020
1 parent 081d749 commit 090d99f
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 71 deletions.
4 changes: 3 additions & 1 deletion cmd/thanos/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,16 @@ func refresh(ctx context.Context, logger log.Logger, bucketUI *ui.Bucket, durati
})
}

func download(ctx context.Context, logger log.Logger, bkt objstore.Bucket, fetcher *block.MetaFetcher) (blocks []metadata.Meta, err error) {
func download(ctx context.Context, logger log.Logger, bkt objstore.Bucket, fetcher *block.MetaFetcher) ([]metadata.Meta, error) {
level.Info(logger).Log("msg", "synchronizing block metadata")

metas, _, err := fetcher.Fetch(ctx)
if err != nil {
return nil, err
}

blocks := []metadata.Meta{}

for _, meta := range metas {
blocks = append(blocks, *meta)
}
Expand Down
Loading

0 comments on commit 090d99f

Please sign in to comment.