mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
refactor(channelserver): extract QuestCache from Server struct
The quest cache fields (lock, data map, expiry map) were spread across Server with manual lock management. The old read path also missed the RLock entirely, creating a data race. Encapsulating in a dedicated type fixes the race and reduces Server's field count by 2.
This commit is contained in:
@@ -58,8 +58,7 @@ func createTestServer() *Server {
|
||||
sessions: make(map[net.Conn]*Session),
|
||||
stages: make(map[string]*Stage),
|
||||
semaphore: make(map[string]*Semaphore),
|
||||
questCacheData: make(map[int][]byte),
|
||||
questCacheTime: make(map[int]time.Time),
|
||||
questCache: NewQuestCache(0),
|
||||
erupeConfig: &cfg.Config{
|
||||
DebugOptions: cfg.DebugOptions{
|
||||
LogOutboundMessages: false,
|
||||
|
||||
Reference in New Issue
Block a user