Skip to content

Commit

Permalink
fix stream handlers copying for Handler.Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Jun 22, 2024
1 parent e73dcc7 commit b9bb0b6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,15 @@ func (h *handler) Clone() Handler {
cp.routes[k] = rh
}

cp.streams = map[string]*streamHandler{}
for k, v := range h.streams {
sh := &streamHandler{
async: v.async,
handler: v.handler,
}
cp.streams[k] = sh
}

ctx, cancel := context.WithCancel(context.Background())
cp.ctx = ctx
cp.cancel = cancel
Expand Down

0 comments on commit b9bb0b6

Please sign in to comment.