Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ce5c19

Browse files
chore: reposition close of update channel
1 parent3e50965 commit6ce5c19

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

‎agent/agentcontainers/api.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,6 @@ func (api *API) watchContainers(rw http.ResponseWriter, r *http.Request) {
570570
deferencoder.Close(websocket.StatusNormalClosure)
571571

572572
updateCh:=make(chanstruct{},1)
573-
deferfunc() {
574-
api.mu.Lock()
575-
close(updateCh)
576-
api.mu.Unlock()
577-
}()
578573

579574
api.mu.Lock()
580575
api.updateChans=append(api.updateChans,updateCh)
@@ -585,6 +580,7 @@ func (api *API) watchContainers(rw http.ResponseWriter, r *http.Request) {
585580
api.updateChans=slices.DeleteFunc(api.updateChans,func(chchanstruct{})bool {
586581
returnch==updateCh
587582
})
583+
close(updateCh)
588584
api.mu.Unlock()
589585
}()
590586

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp