add brief for functions in db, implemet full group manipulation (except owner,color), some fixes
This commit is contained in:
+2
-2
@@ -30,7 +30,7 @@ func ServeWsConnection(responseWriter http.ResponseWriter, request *http.Request
|
||||
defer closeConnection(&client, ignoreCache)
|
||||
for {
|
||||
var clientMessage map[string]any
|
||||
err := wsjson.Read(ctx, connection, &clientMessage)
|
||||
err = wsjson.Read(ctx, connection, &clientMessage)
|
||||
if err != nil {
|
||||
log.Printf("read error: %v", err)
|
||||
return
|
||||
@@ -137,7 +137,6 @@ func handleUnauthenticatedMessage(ctx context.Context, client *Client, clientMes
|
||||
|
||||
clientFromCache, err := CacheGetClientById(clientId)
|
||||
if err != nil {
|
||||
// Not in cache — load from database
|
||||
dbClient := &Client{Id: clientId}
|
||||
err = DbSetClientByIdWithoutGroups(ctx, dbClient)
|
||||
if err != nil {
|
||||
@@ -162,6 +161,7 @@ func handleUnauthenticatedMessage(ctx context.Context, client *Client, clientMes
|
||||
clientFromCache = dbClient
|
||||
}
|
||||
|
||||
clientFromCache.WsConn = client.WsConn
|
||||
*client = *clientFromCache
|
||||
|
||||
for groupId, _ := range clientFromCache.Groups {
|
||||
|
||||
Reference in New Issue
Block a user