TUN-2823: Bugfix. cloudflared would hang forever if error occurred.

This commit is contained in:
Adam Chalmers 2020-03-19 17:48:42 -05:00
parent 6dcf3a4cbc
commit 32df01a9da
1 changed files with 7 additions and 2 deletions

View File

@ -323,8 +323,13 @@ func ServeTunnel(
})
errGroup.Go(func() error {
<-reconnectCh
return fmt.Errorf("received disconnect signal")
select {
case <-reconnectCh:
return fmt.Errorf("received disconnect signal")
case <-serveCtx.Done():
return nil
}
})
errGroup.Go(func() error {