Fix sending of next item in notification queue.
The notification queue used for websocket client notifications had a bug which caused the next queued item in some situations to not be sent, but instead send a previously sent item. This change fixes this by setting the 'next' variable to the next item which must be dequeued, if the queue length is non-zero. This bug did not always manifest itself as if the receiving goroutine was ready, a queued item could be sent directly to it rather than waiting in the queue to be sent at a later time.
This commit is contained in:
parent
790a4f5a6e
commit
da993eb034
1 changed files with 2 additions and 0 deletions
|
@ -160,6 +160,8 @@ out:
|
|||
if len(q) == 0 {
|
||||
dequeue = nil
|
||||
skipQueue = out
|
||||
} else {
|
||||
next = q[0]
|
||||
}
|
||||
|
||||
case <-quit:
|
||||
|
|
Loading…
Reference in a new issue