Skip to content

Commit

Permalink
Flaky blobs caps systemtest
Browse files Browse the repository at this point in the history
  • Loading branch information
eccles committed Aug 7, 2024
1 parent 7d74b38 commit b62c45a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
23 changes: 17 additions & 6 deletions azblob/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 11 additions & 0 deletions azblob/logger.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package azbus

import (
"github.com/datatrails/go-datatrails-common/logger"
)

const (
DebugLevel = logger.DebugLevel
)

type Logger = logger.Logger
2 changes: 2 additions & 0 deletions azblob/storer.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type Storer struct {
containerURL string
containerClient *ContainerClient
serviceClient *ServiceClient

log Logger
}

// New returns new az blob read/write object
Expand Down

0 comments on commit b62c45a

Please sign in to comment.