diff --git a/azblob/list.go b/azblob/list.go index 48f845c..8d9d000 100644 --- a/azblob/list.go +++ b/azblob/list.go @@ -16,12 +16,23 @@ func (azp *Storer) Count(ctx context.Context, tagsFilter string, opts ...Option) logger.Sugar.Debugf("Count") - r, err := azp.FilteredList(ctx, tagsFilter, opts...) - if err != nil { - return 0, err - } - - return int64(len(r.Items)), nil + 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)) + logger.Sugar.Debugf("Count %d (%v)", count, r.Marker) + if r.Marker == nil { + break + } + } + logger.Sugar.Debugf("Count %d", count) + return count, nil } type FilterResponse struct {