server: fix panic during session closure (#671)

This commit is contained in:
Alessandro Ros
2024-12-25 15:54:40 +01:00
committed by GitHub
parent 4d3d6bc108
commit b4181c6e57

View File

@@ -27,12 +27,11 @@ func (w *asyncProcessor) start() {
}
func (w *asyncProcessor) stop() {
if !w.running {
panic("should not happen")
if w.running {
w.buffer.Close()
<-w.chError
w.running = false
}
w.buffer.Close()
<-w.chError
w.running = false
}
func (w *asyncProcessor) run() {