We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e50965 commit 6ce5c19Copy full SHA for 6ce5c19
agent/agentcontainers/api.go
@@ -570,11 +570,6 @@ func (api *API) watchContainers(rw http.ResponseWriter, r *http.Request) {
570
defer encoder.Close(websocket.StatusNormalClosure)
571
572
updateCh := make(chan struct{}, 1)
573
- defer func() {
574
- api.mu.Lock()
575
- close(updateCh)
576
- api.mu.Unlock()
577
- }()
578
579
api.mu.Lock()
580
api.updateChans = append(api.updateChans, updateCh)
@@ -585,6 +580,7 @@ func (api *API) watchContainers(rw http.ResponseWriter, r *http.Request) {
585
api.updateChans = slices.DeleteFunc(api.updateChans, func(ch chan struct{}) bool {
586
581
return ch == updateCh
587
582
})
583
+ close(updateCh)
588
584
api.mu.Unlock()
589
}()
590
0 commit comments