From 673f5a8389985d443c7c7edb7c56392fdfd974a6 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 6 Nov 2020 15:56:07 +0200 Subject: [PATCH] Fix dropped message log --- user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user.go b/user.go index d8607cf..666d785 100644 --- a/user.go +++ b/user.go @@ -799,8 +799,8 @@ func (user *User) runMessageRingBuffer() { select { case user.messageOutput <- msg: default: - user.log.Warnln("Buffer is full, dropping message in", msg.chat) - <-user.messageOutput + dropped := <-user.messageOutput + user.log.Warnln("Buffer is full, dropping message in", dropped.chat) user.messageOutput<-msg } }