diff --git a/client.go b/client.go index 044b1b9..f253280 100644 --- a/client.go +++ b/client.go @@ -15,7 +15,7 @@ func getLockedClient(id int64, createMissing bool) (*ChirpClient, bool) { c := new(ChirpClient) c.TGUserID64 = id c.Active = false - c.Lock() + c.Mux.Lock() muxClients.RUnlock() muxClients.Lock() clients[id] = c diff --git a/main.go b/main.go index 15594e8..fdebccd 100644 --- a/main.go +++ b/main.go @@ -151,10 +151,6 @@ func main() { TGCmdQueue = make(chan TGCommand, TGCmdQueueSize) MQTGCmdQueue = make(chan TGCommand, MQTGCmdQueueSize) JobQueue = make(chan Job, JobQueueSize) - clientsQueue = make(map[int64]*MQClient) - - clientsCW = new(sync.Map) - clientsKeepAlive = new(sync.Map) for w := 1; w <= MQGetMsgWorkers; w++ { go MQGetMsgWorker(w, MQCWMsgQueue)