cloudproxy: agent: wait a while on connect error

This commit is contained in:
Yousong Zhou
2021-05-07 10:03:24 +08:00
parent 532961f520
commit d5f1627872

View File

@@ -190,6 +190,12 @@ func (c *Client) runClientState(ctx context.Context, sshClientC chan *ssh.Client
sshc, err := c.cc.ConnectContext(tmoCtx)
if err != nil {
log.Errorf("ssh connect: %v", err)
waitTmo := time.NewTimer(13 * time.Second)
select {
case <-ctx.Done():
return
case <-waitTmo.C:
}
continue
}