2
0

Tweak RecoverFromTimeout docs

This commit is contained in:
Jack Christensen
2019-01-02 14:20:10 -06:00
parent 475720d172
commit de2b9bb301
+6 -6
View File
@@ -628,12 +628,12 @@ func preferContextOverNetTimeoutError(ctx context.Context, err error) error {
return err return err
} }
// RecoverFromTimeout attempts to recover from a timeout error such as is caused by a canceled context. If recovery is // RecoverFromTimeout attempts to recover from a timeout error such as is caused by a canceled context. This must be
// successful true is returned. If recovery is not successful the connection is closed and false is returned. Recovery // called after any context cancellation. This is not done automatically as RecoverFromTimeout may need to signal the
// should usually be possible except in the case of a partial write. This must be called after any context cancellation. // server to abort the in-progress query and read and ignore data already sent from the server. This potentially can
// // block indefinitely. Use ctx to guard against this. If recovery is successful true is returned. If recovery is not
// As RecoverFromTimeout may need to read and ignored data already sent from the server, it potentially can block // successful the connection is closed and false is returned. Recovery should usually be possible except in the case of
// indefinitely. Use ctx to guard against this. // a partial write.
func (pgConn *PgConn) RecoverFromTimeout(ctx context.Context) bool { func (pgConn *PgConn) RecoverFromTimeout(ctx context.Context) bool {
if pgConn.closed { if pgConn.closed {
return false return false