This commit is contained in:
lpf
2026-03-03 10:36:53 +08:00
parent 35b0ad1bfd
commit bd93c12edc
30 changed files with 1311 additions and 262 deletions

View File

@@ -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,
})