Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(utils/httpbin): make delay return 200 on contex cancel explicit #867

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

mmatczuk
Copy link
Contributor

No description provided.

@@ -69,8 +69,9 @@ func delayHandler(w http.ResponseWriter, r *http.Request) {
case <-r.Context().Done():
t.Stop()
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are here, shouldn't we also defer the timer stop?

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't mention it. It's a timer, not ticker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll add it.

@mmatczuk
Copy link
Contributor Author

Improved commit messages, added deferred timer Stop() call.

@mmatczuk mmatczuk merged commit 60c8276 into main Jul 26, 2024
6 checks passed
@mmatczuk mmatczuk deleted the mmt/nicer_delay branch July 26, 2024 08:19
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