Skip to content

Commit

Permalink
do not use ctx provied from http request
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Jul 22, 2024
1 parent abcb4ce commit 01be279
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,6 @@ func (s *Server) handleMessage(ctx context.Context, ws *WebSocket, message []byt
}

func (s *Server) HandleWebsocket(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
store := s.relay.Storage(ctx)

conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
s.Log.Errorf("failed to upgrade websocket: %v", err)
Expand Down Expand Up @@ -375,6 +372,8 @@ func (s *Server) HandleWebsocket(w http.ResponseWriter, r *http.Request) {

ctx, cancel := context.WithCancel(context.Background())

store := s.relay.Storage(ctx)

// reader
go func() {
defer func() {
Expand Down

0 comments on commit 01be279

Please sign in to comment.