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

Add context option #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GlebBeloded
Copy link

Very useful for timeouts, context loggers and such

@GlebBeloded
Copy link
Author

@eranhare Hi and thank you for replying!

I'm not sure I understand your comment.
I didn't add a new field. I added a way to provide arbitrary context instead of context.TODO() which is created here.

Maybe giving an example would help.

In my pet project I use your healtcheck to monitor sql.DB. So I use your healthcheck, Ping, to be exact.

Inside of the database/sql code I have a hook which uses context. Currently there is no easy to provide context to the healthcheck, so empty TODO context is always passed to db driver methods.

The option added in PR allows to overwrite that TODO context with any other context, which should be used inside checks.

@eranhare
Copy link

eranhare commented Oct 25, 2024 via email

@eranharel
Copy link
Contributor

@GlebBeloded I apologize, I reviewed this from my phone, and missed the point that I was later using the context to pass into health check tasks, and I intended to do exactly what you did but forgot about it...

Thanks, LGTM

@eranharel
Copy link
Contributor

@dmarkhas can you approve and merge?

@dmarkhas
Copy link
Collaborator

I'll review it later today, thanks for the heads up 🙂

@dmarkhas
Copy link
Collaborator

@GlebBeloded can you please add a godoc comment that explains the purpose of the new function?

@GlebBeloded
Copy link
Author

@dmarkhas added a comment!

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.

4 participants