-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
added context cancelling support #86
Conversation
message/router/middleware/retry.go
Outdated
return events, nil | ||
} | ||
|
||
elapsedTime := time.Now().Sub(startTime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S1012: should use time.Since
instead of time.Now().Sub
(from gosimple
)
|
||
startTime := time.Now() | ||
_, _ = h(message.NewMessage("1", nil)) | ||
timeElapsed := time.Now().Sub(startTime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S1012: should use time.Since
instead of time.Now().Sub
(from gosimple
)
message/router/middleware/retry.go
Outdated
|
||
elapsedTime := time.Now().Sub(startTime) | ||
|
||
if r.shouldRetry(retries, elapsedTime) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing this to avoid long nesting?
if !r.shouldRetry(...) {
return
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe break
then and return at the end of the function.
No description provided.