Skip to content

Commit

Permalink
Refactor validate duration > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Cataldo committed Dec 19, 2023
1 parent 19d2891 commit b2c536c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sqs/option/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,22 @@ func GetConsumerByParams(opts []Consumer) Consumer {
if opt.DeleteMessageProcessedSuccess {
result.DeleteMessageProcessedSuccess = opt.DeleteMessageProcessedSuccess
}
if opt.ConsumerMessageTimeout.Seconds() > 0 {
if opt.ConsumerMessageTimeout > 0 {
result.ConsumerMessageTimeout = opt.ConsumerMessageTimeout
}
if opt.DelayQueryLoop.Seconds() > 0 {
if opt.DelayQueryLoop > 0 {
result.DelayQueryLoop = opt.DelayQueryLoop
}
if opt.MaxNumberOfMessages > 0 {
result.MaxNumberOfMessages = opt.MaxNumberOfMessages
}
if opt.VisibilityTimeout.Seconds() > 0 {
if opt.VisibilityTimeout > 0 {
result.VisibilityTimeout = opt.VisibilityTimeout
}
if opt.ReceiveRequestAttemptId != nil && len(*opt.ReceiveRequestAttemptId) != 0 {
result.ReceiveRequestAttemptId = opt.ReceiveRequestAttemptId
}
if opt.WaitTimeSeconds.Seconds() > 0 {
if opt.WaitTimeSeconds > 0 {
result.WaitTimeSeconds = opt.WaitTimeSeconds
}
}
Expand Down
File renamed without changes.

0 comments on commit b2c536c

Please sign in to comment.