1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-30 08:06:40 +02:00

Merge branch 'master' into runtime-multitenancy

This commit is contained in:
ben-toogood 2020-05-19 13:24:35 +01:00 committed by GitHub
commit cf37d64819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,8 +112,8 @@ func (s *service) run(exit chan bool) {
}
func (s *service) register() error {
s.RLock()
defer s.RUnlock()
s.Lock()
defer s.Unlock()
if s.srv == nil {
return nil
@ -142,8 +142,8 @@ func (s *service) register() error {
}
func (s *service) deregister() error {
s.RLock()
defer s.RUnlock()
s.Lock()
defer s.Unlock()
if s.srv == nil {
return nil
@ -406,7 +406,9 @@ func (s *service) Init(opts ...Option) error {
s.RLock()
// pass in own name and version
serviceOpts = append(serviceOpts, micro.Name(s.opts.Name))
if s.opts.Service.Name() == "" {
serviceOpts = append(serviceOpts, micro.Name(s.opts.Name))
}
serviceOpts = append(serviceOpts, micro.Version(s.opts.Version))
s.RUnlock()