server: set registered only after configuring subscribers (#1557)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
213359baed
commit
655bf08aca
10
grpc.go
10
grpc.go
@ -692,11 +692,6 @@ func (g *grpcServer) Register() error {
|
||||
g.Lock()
|
||||
defer g.Unlock()
|
||||
|
||||
if cacheService {
|
||||
g.rsvc = service
|
||||
}
|
||||
g.registered = true
|
||||
|
||||
for sb := range g.subscribers {
|
||||
handler := g.createSubHandler(sb, g.opts)
|
||||
var opts []broker.SubscribeOption
|
||||
@ -722,6 +717,11 @@ func (g *grpcServer) Register() error {
|
||||
g.subscribers[sb] = []broker.Subscriber{sub}
|
||||
}
|
||||
|
||||
g.registered = true
|
||||
if cacheService {
|
||||
g.rsvc = service
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user