feat: remove unused client mutex

- remove unused Mutex from `models.Client` struct
- remove lock from `HandleConnection()`
- replace websocket.Conn with models.Client in `handleClientCommands()`

🤖
This commit is contained in:
Sebastian Mark 2024-10-30 08:09:41 +01:00
parent 94b6786c7c
commit bdfd5c3b84
3 changed files with 8 additions and 12 deletions

View file

@ -3,7 +3,6 @@ package websocket
import (
"encoding/json"
"github.com/charmbracelet/log"
"github.com/gorilla/websocket"
"git.smsvc.net/pomodoro/GoTomato/internal/pomodoro"
"git.smsvc.net/pomodoro/GoTomato/internal/shared"
@ -11,7 +10,8 @@ import (
)
// Listens for commands from a client and handles them
func handleClientCommands(ws *websocket.Conn) {
func handleClientCommands(c models.Client) {
ws := c.Conn
for {
var clientCommand models.ClientCommand