-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] Create function like TestOnBorrow that includes context #442
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this can ever be of use if I'm honest as this is setup on the pool so the ctx with a timeout, which would be the desired use, will expire and resulting in all future calls failing.
@@ -141,6 +141,10 @@ type Pool struct { | |||
// closed. | |||
TestOnBorrow func(c Conn, t time.Time) error | |||
|
|||
// TestOnBorrowWithContext is the same as TestOnBorrow, but includes | |||
// the context. | |||
TestOnBorrowWithContext func(c Conn, t time.Time, ctx context.Context) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context should always be the first parameter, I would also drop the With so its just TestOnBorrowContext
as per Dial
and DailContext
I agree @stevenh , seems kind of pointless then... Should we just close this PR out? |
Closing based on timeout and other feedback. |
But wouldn't it be called with the |
I take it back, @dcormier is correct, reopening. |
This is an initial PR to address issue #439