From 8ad86acf8f497f9f7506b8a009065db82022bff4 Mon Sep 17 00:00:00 2001 From: lbbniu Date: Sat, 17 Jun 2023 11:57:59 +0800 Subject: [PATCH] fix --- tars/registry/registry.go | 2 +- tars/registry/tars/registry.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tars/registry/registry.go b/tars/registry/registry.go index 9b370832..ea4c45bd 100644 --- a/tars/registry/registry.go +++ b/tars/registry/registry.go @@ -25,5 +25,5 @@ type Registrar interface { Deregister(ctx context.Context, servant *ServantInstance) error // QueryServant service discovery QueryServant(ctx context.Context, id string) (activeEp []endpointf.EndpointF, inactiveEp []endpointf.EndpointF, err error) - QueryServantBySet(ctx context.Context, id, setId string) (activeEp []endpointf.EndpointF, inactiveEp []endpointf.EndpointF, err error) + QueryServantBySet(ctx context.Context, id, set string) (activeEp []endpointf.EndpointF, inactiveEp []endpointf.EndpointF, err error) } diff --git a/tars/registry/tars/registry.go b/tars/registry/tars/registry.go index 9e831834..72a426f6 100644 --- a/tars/registry/tars/registry.go +++ b/tars/registry/tars/registry.go @@ -36,13 +36,13 @@ func (t *tarsRegistry) QueryServant(ctx context.Context, id string) (activeEp [] return activeEp, inactiveEp, nil } -func (t *tarsRegistry) QueryServantBySet(ctx context.Context, id, setId string) (activeEp []endpointf.EndpointF, inactiveEp []endpointf.EndpointF, err error) { - ret, err := t.query.FindObjectByIdInSameSetWithContext(ctx, id, setId, &activeEp, &inactiveEp) +func (t *tarsRegistry) QueryServantBySet(ctx context.Context, id, set string) (activeEp []endpointf.EndpointF, inactiveEp []endpointf.EndpointF, err error) { + ret, err := t.query.FindObjectByIdInSameSetWithContext(ctx, id, set, &activeEp, &inactiveEp) if err != nil { return nil, nil, err } if ret != 0 { - return nil, nil, fmt.Errorf("QueryServantBySet id: %s, setId: %s fail, ret: %d", id, setId, ret) + return nil, nil, fmt.Errorf("QueryServantBySet id: %s, setId: %s fail, ret: %d", id, set, ret) } return activeEp, inactiveEp, nil }