nil checks
This commit is contained in:
parent
f5b9d21ffb
commit
6dec232363
1 changed files with 8 additions and 4 deletions
|
|
@ -57,8 +57,10 @@ func (d DynamodbStreamAdapterClient) ListShards(ctx context.Context, params *kin
|
||||||
req, _ := json.Marshal(params)
|
req, _ := json.Marshal(params)
|
||||||
log.Info(fmt.Sprintf("ListShards >>> request %v", string(req)))
|
log.Info(fmt.Sprintf("ListShards >>> request %v", string(req)))
|
||||||
var maxResults int32 = 100
|
var maxResults int32 = 100
|
||||||
if *params.MaxResults >= 100 {
|
if params.MaxResults != nil {
|
||||||
params.MaxResults = &maxResults
|
if 100 >= *params.MaxResults {
|
||||||
|
params.MaxResults = &maxResults
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dynamoOutput, err := d.internalClient.DescribeStream(ctx, &dynamodbstreams.DescribeStreamInput{
|
dynamoOutput, err := d.internalClient.DescribeStream(ctx, &dynamodbstreams.DescribeStreamInput{
|
||||||
ExclusiveStartShardId: params.ExclusiveStartShardId,
|
ExclusiveStartShardId: params.ExclusiveStartShardId,
|
||||||
|
|
@ -279,8 +281,10 @@ func (d DynamodbStreamAdapterClient) convertShardIteratorInput(kinesisInput *kin
|
||||||
|
|
||||||
func (d DynamodbStreamAdapterClient) convertGetRecordsInput(params *kinesis.GetRecordsInput) *dynamodbstreams.GetRecordsInput {
|
func (d DynamodbStreamAdapterClient) convertGetRecordsInput(params *kinesis.GetRecordsInput) *dynamodbstreams.GetRecordsInput {
|
||||||
var dynamoMaxLimit int32 = 1000
|
var dynamoMaxLimit int32 = 1000
|
||||||
if *params.Limit >= 10000 {
|
if params.Limit != nil {
|
||||||
params.Limit = &dynamoMaxLimit
|
if *params.Limit >= 10000 {
|
||||||
|
params.Limit = &dynamoMaxLimit
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dynamoInput := &dynamodbstreams.GetRecordsInput{
|
dynamoInput := &dynamodbstreams.GetRecordsInput{
|
||||||
Limit: params.Limit,
|
Limit: params.Limit,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue