Skip to content

Commit

Permalink
Fixed loop
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Dec 27, 2023
1 parent 31a6023 commit 6d42d68
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/views/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ func (v *Views) Websocket(c echo.Context) error {

log.Println("connected", responseTransporter.Server)

loop := true

ticker := time.NewTicker(5 * time.Second)
defer func() {
ticker.Stop()
_ = ws.Close()
}()

for loop {
for {
select {
case res := <-clientChannel:
err = ws.WriteMessage(websocket.TextMessage, res)
Expand Down Expand Up @@ -134,5 +132,4 @@ func (v *Views) Websocket(c echo.Context) error {
}
}
}
return nil
}

0 comments on commit 6d42d68

Please sign in to comment.