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: add check for context cancel or timeout #82

Merged
merged 3 commits into from
Feb 3, 2023

Conversation

pgautier404
Copy link
Contributor

No description provided.

@pgautier404 pgautier404 force-pushed the support-context-cancel branch from 05a9f22 to b25894f Compare February 3, 2023 01:01
@pgautier404 pgautier404 force-pushed the support-context-cancel branch from b25894f to 3dd0ce8 Compare February 3, 2023 01:07
@pgautier404 pgautier404 marked this pull request as ready for review February 3, 2023 01:09
@pgautier404 pgautier404 force-pushed the support-context-cancel branch from 810cb83 to de0f851 Compare February 3, 2023 20:24
}
time.Sleep(time.Second)
}

// Ensure cancelFunction is called to quiet a context leak warning
cancelFunction()
Copy link
Member

Choose a reason for hiding this comment

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

nit I think this is ok to leave as is. One thing you could do is right when cancelFunction is defined could call
defer cancelFunction() to ensure this is called when this overall function exits

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes, gotcha. I'll make that change in a followup PR, thanks!

Copy link
Member

Choose a reason for hiding this comment

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

yeah sounds good!

Copy link
Member

@eaddingtonwhite eaddingtonwhite left a comment

Choose a reason for hiding this comment

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

Nice @pgautier404 Thanks for jumping on this!

@pgautier404 pgautier404 merged commit 3e0087d into main Feb 3, 2023
@pgautier404 pgautier404 deleted the support-context-cancel branch February 3, 2023 23:35
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