Skip to content

Commit

Permalink
Flaky blobs caps systemtest
Browse files Browse the repository at this point in the history
AB#5311
  • Loading branch information
eccles committed Aug 7, 2024
1 parent 7d74b38 commit af351b7
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions azblob/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,28 @@ import (

// Count counts the number of blobs filtered by the given tags filter
func (azp *Storer) Count(ctx context.Context, tagsFilter string, opts ...Option) (int64, error) {

logger.Sugar.Debugf("Count")

r, err := azp.FilteredList(ctx, tagsFilter, opts...)
if err != nil {
return 0, err
}

return int64(len(r.Items)), nil
log := logger.Sugar.FromContext(ctx)
defer log.Close()

log.Debugf("Count")

var count int64
var m string
opts = append(opts, WithListMarker(&m))

for {
r, err := azp.FilteredList(ctx, tagsFilter, opts...)
if err != nil {
return 0, err
}
count += int64(len(r.Items))
log.Debugf("Count %d (%v)", count, r.Marker)
if r.Marker == nil {
break
}
}
log.Debugf("Count %d", count)
return count, nil
}

type FilterResponse struct {
Expand Down

0 comments on commit af351b7

Please sign in to comment.