fix: remove duplicate client registration
- delete the client creation logic from handleClientCommands
This commit is contained in:
parent
0b2f83cd35
commit
b71d04aad2
2 changed files with 2 additions and 7 deletions
|
@ -15,13 +15,6 @@ var mu sync.Mutex // Mutex to protect access to the Clients map
|
|||
|
||||
// handleClientCommands listens for commands from WebSocket clients and dispatches to the timer.
|
||||
func handleClientCommands(ws *websocket.Conn) {
|
||||
// Create a new Client and add it to the Clients map
|
||||
mu.Lock()
|
||||
Clients[ws] = &models.Client{
|
||||
Conn: ws,
|
||||
}
|
||||
mu.Unlock()
|
||||
|
||||
for {
|
||||
_, message, err := ws.ReadMessage()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue