Skip to content

Commit f858af1

Browse files
authored
fix: wait for dispatch goroutine to finish (#780)
* wait for dispatch goroutine to finish * move the wait into write function
1 parent 9f28716 commit f858af1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subscribe.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ func (h *Hub) write(w io.Writer, s zapcore.ObjectMarshaler, data string) bool {
222222
c.Write(zap.Object("subscriber", s))
223223
}
224224

225+
// wait for the dispatch goroutine to finish
226+
<-done
225227
return false
226228
}
227229
}

0 commit comments

Comments
 (0)