Skip to content

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

Merged
mmatczuk merged 2 commits intomainfrom
mmt/nicer_delay
Jul 26, 2024
Merged

chore(utils/httpbin): make delay return 200 on contex cancel explicit#867
mmatczuk merged 2 commits intomainfrom
mmt/nicer_delay

Conversation

@mmatczuk
Copy link
Contributor

No description provided.

@mmatczuk mmatczuk requested a review from Choraden as a code owner July 25, 2024 12:20
@@ -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
@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