mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
perf与性能优化
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
type Service struct{}
|
||||
|
||||
func NewService(conn *nats.Conn) (*Service, error) {
|
||||
func NewService(conn *nats.Conn, gsId uint32) (*Service, error) {
|
||||
enc, err := nats.NewEncodedConn(conn, protobuf.PROTOBUF_ENCODER)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -20,7 +20,7 @@ func NewService(conn *nats.Conn) (*Service, error) {
|
||||
return nil, err
|
||||
}
|
||||
gs := &GMService{}
|
||||
_, err = api.RegisterGMNATSRPCServer(svr, gs)
|
||||
_, err = api.RegisterGMNATSRPCServer(svr, gs, natsrpc.WithServiceID(gsId))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user