We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 877b999 commit eedcf95Copy full SHA for eedcf95
stream.go
@@ -220,17 +220,22 @@ START:
220
221
WAIT:
222
var timeout <-chan time.Time
223
+ var timer *time.Timer
224
writeDeadline := s.writeDeadline.Load().(time.Time)
225
if !writeDeadline.IsZero() {
226
delay := time.Until(writeDeadline)
- timeout = time.After(delay)
227
+ timer = time.NewTimer(delay)
228
+ timeout = timer.C
229
}
230
select {
231
case <-s.session.shutdownCh:
232
case <-s.sendNotifyCh:
233
case <-timeout:
234
return 0, ErrTimeout
235
236
+ if timer != nil {
237
+ timer.Stop()
238
+ }
239
goto START
240
241
0 commit comments