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
|
@ -23,9 +23,11 @@ func HandleConnections(w http.ResponseWriter, r *http.Request) {
|
|||
defer ws.Close()
|
||||
|
||||
// Register the new client
|
||||
mu.Lock()
|
||||
Clients[ws] = &models.Client{
|
||||
Conn: ws, // Store the WebSocket connection
|
||||
}
|
||||
mu.Unlock()
|
||||
|
||||
// Listen for commands from the connected client
|
||||
handleClientCommands(ws)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue