Skip to content

Commit

Permalink
修改代码
Browse files Browse the repository at this point in the history
  • Loading branch information
pangdogs committed Jul 24, 2024
1 parent 84fc29f commit a4c3e02
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/dserv/distservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ func (d *_DistService) SendMsg(dst string, msg gap.Msg) error {
seq = d.deduplication.Make()
}

buf, err := d.encoder.Encode(d.servCtx.GetName(), d.details.LocalAddr, seq, msg)
mpBuf, err := d.encoder.Encode(d.servCtx.GetName(), d.details.LocalAddr, seq, msg)
if err != nil {
return err
}
defer buf.Release()
defer mpBuf.Release()

return d.broker.Publish(d.ctx, dst, buf.Data())
return d.broker.Publish(d.ctx, dst, mpBuf.Data())
}

// ForwardMsg 转发消息
Expand All @@ -248,13 +248,13 @@ func (d *_DistService) ForwardMsg(svc, src, dst string, seq int64, msg gap.Msg)
return fmt.Errorf("%w: msg is nil", core.ErrArgs)
}

buf, err := d.encoder.Encode(svc, src, seq, msg)
mpBuf, err := d.encoder.Encode(svc, src, seq, msg)
if err != nil {
return err
}
defer buf.Release()
defer mpBuf.Release()

return d.broker.Publish(d.ctx, dst, buf.Data())
return d.broker.Publish(d.ctx, dst, mpBuf.Data())
}

// WatchMsg 监听消息(优先级高)
Expand Down

0 comments on commit a4c3e02

Please sign in to comment.