We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 545b28d commit 00fc76cCopy full SHA for 00fc76c
1 file changed
messagequeue/messagequeue.go
@@ -68,6 +68,7 @@ type MessageQueue struct {
68
69
outgoingWork chan struct{}
70
done chan struct{}
71
+ doneOnce sync.Once
72
73
// internal do not touch outside go routines
74
sender gsnet.MessageSender
@@ -144,7 +145,9 @@ func (mq *MessageQueue) Startup() {
144
145
146
// Shutdown stops the processing of messages for a message queue.
147
func (mq *MessageQueue) Shutdown() {
- close(mq.done)
148
+ mq.doneOnce.Do(func() {
149
+ close(mq.done)
150
+ })
151
}
152
153
func (mq *MessageQueue) runQueue() {
0 commit comments