mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-28 08:47:38 +08:00
fix logs
This commit is contained in:
@@ -37,7 +37,7 @@ func (mb *MessageBus) PublishInbound(msg InboundMessage) {
|
||||
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
logger.WarnCF("bus", "PublishInbound on closed channel recovered", map[string]interface{}{
|
||||
logger.WarnCF("bus", logger.C0129, map[string]interface{}{
|
||||
logger.FieldChannel: msg.Channel,
|
||||
logger.FieldChatID: msg.ChatID,
|
||||
"session_key": msg.SessionKey,
|
||||
@@ -48,7 +48,7 @@ func (mb *MessageBus) PublishInbound(msg InboundMessage) {
|
||||
select {
|
||||
case ch <- msg:
|
||||
case <-time.After(queueWriteTimeout):
|
||||
logger.ErrorCF("bus", "PublishInbound timeout (queue full)", map[string]interface{}{
|
||||
logger.ErrorCF("bus", logger.C0130, map[string]interface{}{
|
||||
logger.FieldChannel: msg.Channel,
|
||||
logger.FieldChatID: msg.ChatID,
|
||||
"session_key": msg.SessionKey,
|
||||
@@ -76,7 +76,7 @@ func (mb *MessageBus) PublishOutbound(msg OutboundMessage) {
|
||||
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
logger.WarnCF("bus", "PublishOutbound on closed channel recovered", map[string]interface{}{
|
||||
logger.WarnCF("bus", logger.C0131, map[string]interface{}{
|
||||
logger.FieldChannel: msg.Channel,
|
||||
logger.FieldChatID: msg.ChatID,
|
||||
})
|
||||
@@ -86,7 +86,7 @@ func (mb *MessageBus) PublishOutbound(msg OutboundMessage) {
|
||||
select {
|
||||
case ch <- msg:
|
||||
case <-time.After(queueWriteTimeout):
|
||||
logger.ErrorCF("bus", "PublishOutbound timeout (queue full)", map[string]interface{}{
|
||||
logger.ErrorCF("bus", logger.C0132, map[string]interface{}{
|
||||
logger.FieldChannel: msg.Channel,
|
||||
logger.FieldChatID: msg.ChatID,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user