Fix dropped message log

This commit is contained in:
Tulir Asokan 2020-11-06 15:56:07 +02:00
parent 4eacece8ba
commit 673f5a8389

View file

@ -799,8 +799,8 @@ func (user *User) runMessageRingBuffer() {
select { select {
case user.messageOutput <- msg: case user.messageOutput <- msg:
default: default:
user.log.Warnln("Buffer is full, dropping message in", msg.chat) dropped := <-user.messageOutput
<-user.messageOutput user.log.Warnln("Buffer is full, dropping message in", dropped.chat)
user.messageOutput<-msg user.messageOutput<-msg
} }
} }