diff --git a/pkg/dataplane/itemscursor.go b/pkg/dataplane/itemscursor.go index 2f1f540..ccdaf12 100644 --- a/pkg/dataplane/itemscursor.go +++ b/pkg/dataplane/itemscursor.go @@ -1,5 +1,7 @@ package v3io +import "time" + type ItemsCursor struct { currentItem Item currentError error @@ -75,6 +77,10 @@ func (ic *ItemsCursor) NextItemSync() (Item, error) { // get the previous request input and modify it with the marker ic.getItemsInput.Marker = ic.nextMarker + if ic.getItemsInput.ChokeGetItemsMS != 0 { + time.Sleep(time.Duration(ic.getItemsInput.ChokeGetItemsMS) * time.Millisecond) + } + // invoke get items newResponse, err := ic.container.GetItemsSync(ic.getItemsInput) if err != nil { diff --git a/pkg/dataplane/types.go b/pkg/dataplane/types.go index 0ff81a6..29e89ab 100755 --- a/pkg/dataplane/types.go +++ b/pkg/dataplane/types.go @@ -297,6 +297,7 @@ type GetItemsInput struct { ReturnData string DataMaxSize int RequestJSONResponse bool `json:"RequestJsonResponse"` + ChokeGetItemsMS int } type GetItemsOutput struct {