1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-06-19 05:55:04 +08:00
This commit is contained in:
wdvxdr 2022-06-05 19:04:39 +08:00
parent d25209c366
commit e4c73d59a5
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6

View File

@ -363,7 +363,9 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) {
}
req.Header = header
res, err = c.client.Do(req)
if err != nil {
if err == nil {
break
}
if i < c.MaxRetries {
log.Warnf("上报 Event 数据到 %v 失败: %v 将进行第 %d 次重试", c.addr, err, i+1)
} else {
@ -372,7 +374,6 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) {
}
time.Sleep(time.Millisecond * time.Duration(c.RetriesInterval))
}
}
defer res.Body.Close()
log.Debugf("上报Event数据 %s 到 %v", e.JSONBytes(), c.addr)