mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 02:43:05 +00:00
Fix lint error
This commit is contained in:
parent
9ef031f0f8
commit
72fd2a2780
1 changed files with 4 additions and 2 deletions
|
@ -282,9 +282,11 @@ func getHeadscaleApp() (*headscale.Headscale, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHeadscaleGRPCClient() (apiV1.HeadscaleServiceClient, *grpc.ClientConn) {
|
func getHeadscaleGRPCClient() (apiV1.HeadscaleServiceClient, *grpc.ClientConn) {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
grpcOptions := []grpc.DialOption{
|
grpcOptions := []grpc.DialOption{
|
||||||
// TODO(kradalby): Make configurable
|
// TODO(kradalby): Make configurable
|
||||||
grpc.WithTimeout(5 * time.Second),
|
|
||||||
grpc.WithBlock(),
|
grpc.WithBlock(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +331,7 @@ func getHeadscaleGRPCClient() (apiV1.HeadscaleServiceClient, *grpc.ClientConn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Trace().Caller().Str("address", address).Msg("Connecting via gRPC")
|
log.Trace().Caller().Str("address", address).Msg("Connecting via gRPC")
|
||||||
conn, err := grpc.Dial(address, grpcOptions...)
|
conn, err := grpc.DialContext(ctx, address, grpcOptions...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msgf("Could not connect: %v", err)
|
log.Fatal().Err(err).Msgf("Could not connect: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue