Skip to content

Commit b3e9764

Browse files
committed
Minor improvements
1 parent a97030c commit b3e9764

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

websocket.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (c *Conn) timeoutLoop() {
201201
parentCtx := context.Background()
202202
cancelCtx := func() {}
203203
defer func() {
204-
// We do not defer cancelCtx because its value can change.
204+
// We do not defer cancelCtx directly because its value may change.
205205
cancelCtx()
206206
}()
207207

@@ -224,9 +224,6 @@ func (c *Conn) timeoutLoop() {
224224
select {
225225
case <-c.closed:
226226
return
227-
case <-parentCtx.Done():
228-
c.close(xerrors.Errorf("parent context cancelled: %w", parentCtx.Err()))
229-
return
230227
case c.getConnContext <- ctx:
231228
}
232229
}

0 commit comments

Comments
 (0)