refactor: move broadcast package to websocket
- update import paths to reflect the new package name
- change function call to use the new websocket package
- adjust client iteration to use the renamed Clients variable
🤖
This commit is contained in:
parent
aab6896c7d
commit
6ffd9f1e38
2 changed files with 3 additions and 5 deletions
|
@ -1,9 +1,8 @@
|
|||
package broadcast
|
||||
package websocket
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.smsvc.net/pomodoro/GoTomato/internal/shared"
|
||||
ws "git.smsvc.net/pomodoro/GoTomato/internal/websocket"
|
||||
"github.com/gorilla/websocket"
|
||||
"log"
|
||||
"time"
|
||||
|
@ -19,7 +18,7 @@ func SendPermanentBroadCastMessage() {
|
|||
return
|
||||
}
|
||||
// Iterate over all connected clients and broadcast the message
|
||||
for _, client := range ws.Clients {
|
||||
for _, client := range Clients {
|
||||
err := client.SendMessage(websocket.TextMessage, jsonMessage)
|
||||
if err != nil {
|
||||
log.Printf("Error broadcasting to client: %v", err)
|
Loading…
Add table
Add a link
Reference in a new issue