Skip to content

Commit

Permalink
fix: wait for dispatch goroutine to finish (#780)
Browse files Browse the repository at this point in the history
* wait for dispatch goroutine to finish

* move the wait into write function
  • Loading branch information
WeidiDeng authored Jun 4, 2023
1 parent 9f28716 commit f858af1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func (h *Hub) write(w io.Writer, s zapcore.ObjectMarshaler, data string) bool {
c.Write(zap.Object("subscriber", s))
}

// wait for the dispatch goroutine to finish
<-done
return false
}
}
Expand Down

0 comments on commit f858af1

Please sign in to comment.