Fix collection alias ut (#8292)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/8064/head
dragondriver 2021-09-22 16:10:07 +08:00 committed by GitHub
parent a514270c5f
commit 6345d05bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 3 deletions

View File

@ -562,21 +562,45 @@ func (c *GrpcClient) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequ
func (c *GrpcClient) CreateAlias(ctx context.Context, req *milvuspb.CreateAliasRequest) (*commonpb.Status, error) {
ret, err := c.recall(func() (interface{}, error) {
return c.grpcClient.CreateAlias(ctx, req)
client, err := c.getGrpcClient()
if err != nil {
return nil, err
}
return client.CreateAlias(ctx, req)
})
if err != nil || ret == nil {
return nil, err
}
return ret.(*commonpb.Status), err
}
func (c *GrpcClient) DropAlias(ctx context.Context, req *milvuspb.DropAliasRequest) (*commonpb.Status, error) {
ret, err := c.recall(func() (interface{}, error) {
return c.grpcClient.DropAlias(ctx, req)
client, err := c.getGrpcClient()
if err != nil {
return nil, err
}
return client.DropAlias(ctx, req)
})
if err != nil || ret == nil {
return nil, err
}
return ret.(*commonpb.Status), err
}
func (c *GrpcClient) AlterAlias(ctx context.Context, req *milvuspb.AlterAliasRequest) (*commonpb.Status, error) {
ret, err := c.recall(func() (interface{}, error) {
return c.grpcClient.AlterAlias(ctx, req)
client, err := c.getGrpcClient()
if err != nil {
return nil, err
}
return client.AlterAlias(ctx, req)
})
if err != nil || ret == nil {
return nil, err
}
return ret.(*commonpb.Status), err
}