Skip to content

Commit 3577d95

Browse files
Avoid panic when queue is done
Avoid panic when queue is closed
1 parent 9ff3a8c commit 3577d95

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

driver/sql/projection_notification_queue.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,10 @@ func (nq *NotificationQueue) queueNotification(notification *ProjectionNotificat
114114
nq.queueLock.Lock()
115115
defer nq.queueLock.Unlock()
116116

117-
nq.queue <- notification
117+
select {
118+
case <-nq.done:
119+
return
120+
default:
121+
nq.queue <- notification
122+
}
118123
}

0 commit comments

Comments
 (0)