Skip to content

Commit

Permalink
Set grpc transport request timeout (openconfig#2541)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-dennis authored Jan 12, 2024
1 parent b0c90a5 commit b526036
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion topologies/binding/binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,12 @@ func (a *staticATE) DialOTG(ctx context.Context, opts ...grpc.DialOption) (gosna
if err != nil {
return nil, err
}

api := gosnappi.NewApi()
api.NewGrpcTransport().SetClientConnection(conn)
transport := api.NewGrpcTransport().SetClientConnection(conn)
if timeout := a.r.dutGRPC(a.dev, dutSvcParams[introspect.OTG]).Timeout; timeout != 0 {
transport.SetRequestTimeout(time.Duration(timeout) * time.Second)
}
return api, nil
}

Expand Down

0 comments on commit b526036

Please sign in to comment.