Fix ctrl+c during dashboard execution causing a "panic: send on closed channel". Closes #2048

This commit is contained in:
kaidaguerre
2022-05-12 10:21:55 +01:00
committed by GitHub
parent 1a27d04bba
commit 12bdf62311

View File

@@ -13,8 +13,10 @@ import (
)
func (w *Workspace) PublishDashboardEvent(e dashboardevents.DashboardEvent) {
// send an event onto the event bus
w.dashboardEventChan <- e
if w.dashboardEventChan != nil {
// send an event onto the event bus
w.dashboardEventChan <- e
}
}
// RegisterDashboardEventHandler starts the event handler goroutine if necessary and
@@ -34,6 +36,7 @@ func (w *Workspace) handleDashboardEvent() {
for {
e := <-w.dashboardEventChan
if e == nil {
w.dashboardEventChan = nil
return
}