diff --git a/storage/stow_store.go b/storage/stow_store.go index 6a63ad7..18f7fb7 100644 --- a/storage/stow_store.go +++ b/storage/stow_store.go @@ -7,6 +7,8 @@ import ( "sync" "time" + "github.com/flyteorg/flytestdlib/errors" + "github.com/aws/aws-sdk-go/aws/awserr" s32 "github.com/aws/aws-sdk-go/service/s3" "github.com/graymeta/stow/azure" @@ -20,8 +22,6 @@ import ( "github.com/flyteorg/flytestdlib/logger" "github.com/flyteorg/flytestdlib/promutils/labeled" - "github.com/flyteorg/flytestdlib/errors" - "github.com/flyteorg/flytestdlib/promutils" "github.com/graymeta/stow" @@ -230,8 +230,10 @@ func (s *StowStore) ReadRaw(ctx context.Context, reference DataReference) (io.Re return nil, err } - if sizeMbs := sizeBytes / MiB; sizeMbs > GetConfig().Limits.GetLimitMegabytes && GetConfig().Limits.GetLimitMegabytes != 0 { - return nil, errors.Errorf(ErrExceedsLimit, "limit exceeded. %vmb > %vmb.", sizeMbs, GetConfig().Limits.GetLimitMegabytes) + if GetConfig().Limits.GetLimitMegabytes != 0 { + if sizeMbs := sizeBytes / MiB; sizeMbs > GetConfig().Limits.GetLimitMegabytes { + return nil, errors.Errorf(ErrExceedsLimit, "limit exceeded. %vmb > %vmb.", sizeMbs, GetConfig().Limits.GetLimitMegabytes) + } } return item.Open()