mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-26 09:33:02 +01:00
refactor(channelserver): extract UserBinaryStore and MinidataStore
The userBinary and minidata maps with their locks were spread across Server as raw fields with manual lock management. Cross-channel session searches also required acquiring nested locks (server lock + binary lock). Encapsulating in dedicated types eliminates the nested locking and reduces Server's field count by 4.
This commit is contained in:
@@ -14,7 +14,7 @@ func createTestChannels(count int) []*Server {
|
||||
s.IP = "10.0.0.1"
|
||||
s.Port = uint16(54001 + i)
|
||||
s.GlobalID = "0101"
|
||||
s.userBinaryParts = make(map[userBinaryPartID][]byte)
|
||||
s.userBinary = NewUserBinaryStore()
|
||||
channels[i] = s
|
||||
}
|
||||
return channels
|
||||
|
||||
Reference in New Issue
Block a user