Login exits on a single attempt to connect to management (#220)

* fix: login exits on a single attempt to connect to management

* chore: add log verbosity for Login operation
This commit is contained in:
Mikhail Bragin
2022-02-06 18:56:00 +01:00
committed by GitHub
parent efbb5acf63
commit 3c959bb178
3 changed files with 74 additions and 49 deletions

View File

@@ -58,7 +58,7 @@ func NewClient(ctx context.Context, addr string, key wgtypes.Key, tlsEnabled boo
transportOption = grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{}))
}
sigCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
sigCtx, cancel := context.WithTimeout(ctx, time.Second*3)
defer cancel()
conn, err := grpc.DialContext(
sigCtx,
@@ -291,7 +291,7 @@ func (c *GrpcClient) Send(msg *proto.Message) error {
return err
}
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
defer cancel()
_, err = c.realClient.Send(ctx, encryptedMessage)
if err != nil {