Skip to content

Commit

Permalink
try fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Apr 10, 2024
1 parent 950735e commit 149f6e6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions client/rate_limit_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (

grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
)

// ref: https://github.com/grpc-ecosystem/go-grpc-middleware
Expand Down Expand Up @@ -68,20 +67,16 @@ func retryOnRateLimit(ctx context.Context) bool {
return retry
}

type withStatus interface {
GetStatus() *commonpb.Status
}

// getResultStatus returns status of response.
func getResultStatus(reply interface{}) *commonpb.Status {
switch r := reply.(type) {
case *commonpb.Status:
return r
case *milvuspb.MutationResult:
return r.GetStatus()
case *milvuspb.BoolResponse:
return r.GetStatus()
case *milvuspb.SearchResults:
return r.GetStatus()
case *milvuspb.QueryResults:
return r.GetStatus()
case *milvuspb.FlushResponse:
case withStatus:
return r.GetStatus()
default:
return nil
Expand Down

0 comments on commit 149f6e6

Please sign in to comment.