mirror of https://github.com/jackc/pgx.git
Only set c.fakeNonblockingReadWaitDuration when it will be decreased
parent
cf78472ce5
commit
f46d35610e
|
@ -432,10 +432,10 @@ func (c *NetConn) fakeNonblockingRead(b []byte) (n int, err error) {
|
|||
// a Read deadline will not block a read before it has a chance to read data already in Go or the OS's receive
|
||||
// buffer.
|
||||
proposedWait := endTime.Sub(startTime) * 2
|
||||
if proposedWait < minNonblockingReadWaitDuration {
|
||||
proposedWait = minNonblockingReadWaitDuration
|
||||
}
|
||||
if proposedWait < c.fakeNonblockingReadWaitDuration {
|
||||
if proposedWait < minNonblockingReadWaitDuration {
|
||||
proposedWait = minNonblockingReadWaitDuration
|
||||
}
|
||||
c.fakeNonblockingReadWaitDuration = proposedWait
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue