update
This commit is contained in:
parent
8eadfe3353
commit
da40b74b6c
3
main.go
3
main.go
@ -107,6 +107,9 @@ func main() {
|
|||||||
ownUserID32 = OwnUserID(client)
|
ownUserID32 = OwnUserID(client)
|
||||||
ownUserID64 = int64(OwnUserID(client))
|
ownUserID64 = int64(OwnUserID(client))
|
||||||
|
|
||||||
|
lastChatTDMsg = make(map[int64]time.Time)
|
||||||
|
lastChatTDMsgMux = make(map[int64]*sync.Mutex)
|
||||||
|
|
||||||
MQCWMsgQueue = make(chan ChatWarsMessage, 100)
|
MQCWMsgQueue = make(chan ChatWarsMessage, 100)
|
||||||
for w := 1; w <= 3; w++ {
|
for w := 1; w <= 3; w++ {
|
||||||
go MQSendMsgWorker(w, MQCWMsgQueue)
|
go MQSendMsgWorker(w, MQCWMsgQueue)
|
||||||
|
3
td.go
3
td.go
@ -75,8 +75,7 @@ func ListenTG(c *tdlib.Client) {
|
|||||||
lastChatMsgMux.RUnlock()
|
lastChatMsgMux.RUnlock()
|
||||||
lastChatMsgMux.Lock()
|
lastChatMsgMux.Lock()
|
||||||
if _, ok := lastChatTDMsg[m.ChatID64]; !ok {
|
if _, ok := lastChatTDMsg[m.ChatID64]; !ok {
|
||||||
initTime := time.Now().Add(-1 * time.Second)
|
lastChatTDMsg[m.ChatID64] = time.Now().Add(-1 * time.Second)
|
||||||
lastChatTDMsg[m.ChatID64] = initTime
|
|
||||||
lastChatTDMsgMux[m.ChatID64] = new(sync.Mutex)
|
lastChatTDMsgMux[m.ChatID64] = new(sync.Mutex)
|
||||||
}
|
}
|
||||||
lastChatMsgMux.Unlock()
|
lastChatMsgMux.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user