Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lbbniu committed Jun 17, 2023
1 parent ad6f1ee commit 8ad86ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tars/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 3 additions & 3 deletions tars/registry/tars/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 8ad86ac

Please sign in to comment.