Compare commits
2 Commits
ce5597f4dd
...
6b3ef52738
| Author | SHA1 | Date |
|---|---|---|
|
|
6b3ef52738 | |
|
|
52689749bf |
|
|
@ -174,6 +174,7 @@ func (s *SendCardClient) processContentChannel(ctx context.Context, cardSend *Ca
|
||||||
// 通道关闭,发送最终内容
|
// 通道关闭,发送最终内容
|
||||||
if contentBuilder.Len() > 0 {
|
if contentBuilder.Len() > 0 {
|
||||||
if err := s.updateCardContent(ctx, cardSend, cardInstanceId, contentBuilder.String(), client); err != nil {
|
if err := s.updateCardContent(ctx, cardSend, cardInstanceId, contentBuilder.String(), client); err != nil {
|
||||||
|
log.Info("contentBuilder.Len()修改失败1")
|
||||||
s.logger.Errorf("更新卡片失败1:%s", err.Error())
|
s.logger.Errorf("更新卡片失败1:%s", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -182,6 +183,7 @@ func (s *SendCardClient) processContentChannel(ctx context.Context, cardSend *Ca
|
||||||
contentBuilder.WriteString(content)
|
contentBuilder.WriteString(content)
|
||||||
if contentBuilder.Len() > 0 {
|
if contentBuilder.Len() > 0 {
|
||||||
if err := s.updateCardContent(ctx, cardSend, cardInstanceId, contentBuilder.String(), client); err != nil {
|
if err := s.updateCardContent(ctx, cardSend, cardInstanceId, contentBuilder.String(), client); err != nil {
|
||||||
|
log.Info("contentBuilder.Len()修改失败2")
|
||||||
s.logger.Errorf("更新卡片失败2:%s", err.Error())
|
s.logger.Errorf("更新卡片失败2:%s", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -189,10 +191,12 @@ func (s *SendCardClient) processContentChannel(ctx context.Context, cardSend *Ca
|
||||||
|
|
||||||
case <-heartbeatTicker.C:
|
case <-heartbeatTicker.C:
|
||||||
if time.Now().Unix()-lastUpdate.Unix() >= HeardBeatX {
|
if time.Now().Unix()-lastUpdate.Unix() >= HeardBeatX {
|
||||||
|
log.Info("心跳超时")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
log.Info("send_card上下文失效")
|
||||||
s.logger.Info("context canceled, stop channel processing")
|
s.logger.Info("context canceled, stop channel processing")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue