Skip to content

Commit

Permalink
fix buffer race
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrs4s committed Jun 14, 2022
1 parent babf35e commit 7e24f8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coolq/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ func (bot *CQBot) dispatch(ev *event) {
for _, f := range bot.events {
go func(fn func(*Event)) {
defer func() {
wg.Done()
if pan := recover(); pan != nil {
log.Warnf("处理事件 %v 时出现错误: %v \n%s", event.JSONString(), pan, debug.Stack())
}
wg.Done()
}()

start := time.Now()
Expand Down

0 comments on commit 7e24f8b

Please sign in to comment.