databus.go 464 B

1234567891011121314151617181920
  1. package dao
  2. import (
  3. "context"
  4. "strconv"
  5. "go-common/app/service/main/history/model"
  6. "go-common/library/log"
  7. "go-common/library/stat/prom"
  8. )
  9. // AddHistoryMessage .
  10. func (d *Dao) AddHistoryMessage(c context.Context, k int, msg []*model.Merge) (err error) {
  11. key := strconv.Itoa(k)
  12. prom.BusinessInfoCount.Add("dbus-"+key, int64(len(msg)))
  13. if err = d.mergeDbus.Send(c, key, msg); err != nil {
  14. log.Error("Pub(%s,%+v) error(%v)", key, msg, err)
  15. }
  16. return
  17. }