Skip to content

Conversation

@waigani
Copy link
Owner

@waigani waigani commented Oct 20, 2020

No description provided.

@waigani
Copy link
Owner Author

waigani commented Oct 20, 2020

@codelingo review

@codelingo
Copy link

codelingo bot commented Oct 20, 2020

Running fresh review.

CodeLingoBot help

Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found.

delay = 10 * time.Second
}
select {
case <-time.After(delay):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make one ticker as opposed to making a new timer each iteration.

View Rule

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codelingo It'd be helpful if the comment explained a bit more of the why here: you're essentially avoiding a mem leak as a new timer object is created on each iteration.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delay = 10 * time.Second
}
select {
case <-time.After(delay):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make one ticker as opposed to making a new timer each iteration.

View Rule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants