#19 fixes retry on kinesis error
This commit is contained in:
parent
2d05606a38
commit
ca7a109d1b
1 changed files with 5 additions and 3 deletions
|
|
@ -276,10 +276,12 @@ func (c *Consumer) getShardIterator(ctx context.Context, streamName, shardID, se
|
||||||
}
|
}
|
||||||
|
|
||||||
func isRetriableError(err error) bool {
|
func isRetriableError(err error) bool {
|
||||||
switch err.(type) {
|
var expiredIteratorException *types.ExpiredIteratorException
|
||||||
case *types.ExpiredIteratorException:
|
var provisionedThroughputExceededException *types.ProvisionedThroughputExceededException
|
||||||
|
switch {
|
||||||
|
case errors.As(err, &expiredIteratorException):
|
||||||
return true
|
return true
|
||||||
case *types.ProvisionedThroughputExceededException:
|
case errors.As(err, &provisionedThroughputExceededException):
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue