Skip to content

Commit

Permalink
check deadline timer before signaling
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Feb 26, 2024
1 parent ee5f2e7 commit 7961bab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ func (s *Stream) SetReadDeadline(deadline time.Time) error {
t.Stop()
return
case <-t.C:
select {
case <-readTimeoutCancel:
return

Check warning on line 180 in stream.go

View check run for this annotation

Codecov / codecov/patch

stream.go#L179-L180

Added lines #L179 - L180 were not covered by tests
default:
}
s.lock.Lock()
if s.readErr == nil {
s.readErr = ErrReadDeadlineExceeded
Expand Down

0 comments on commit 7961bab

Please sign in to comment.