update all

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-02-19 00:14:44 +03:00
parent c4890abf41
commit 804ef79601
3 changed files with 117 additions and 50 deletions

View File

@@ -17,7 +17,7 @@ import (
"github.com/golang/protobuf/proto"
"github.com/google/uuid"
"github.com/hashicorp/memberlist"
"github.com/mitchellh/hashstructure"
"github.com/mitchellh/hashstructure/v2"
pb "github.com/unistack-org/micro-register-gossip/v3/proto"
"github.com/unistack-org/micro/v3/logger"
"github.com/unistack-org/micro/v3/register"
@@ -659,7 +659,7 @@ func (g *gossipRegister) run() {
// we need to expire the node at some point in the future
if u.Update.Expires > 0 {
// create a hash of this service
if hash, err := hashstructure.Hash(u.Service, nil); err == nil {
if hash, err := hashstructure.Hash(u.Service, hashstructure.FormatV2, nil); err == nil {
updates.Lock()
updates.services[hash] = u
updates.Unlock()
@@ -680,7 +680,7 @@ func (g *gossipRegister) run() {
go g.publish(actionTypeString(actionTypeDelete), []*register.Service{u.Service})
// delete from expiry checks
if hash, err := hashstructure.Hash(u.Service, nil); err == nil {
if hash, err := hashstructure.Hash(u.Service, hashstructure.FormatV2, nil); err == nil {
updates.Lock()
delete(updates.services, hash)
updates.Unlock()