fix: routinely ping agent websocket to ensure liveness (#5824)

This commit is contained in:
Colin Adler
2023-01-23 20:05:29 +00:00
committed by GitHub
parent ba8dd496c3
commit d2ae16dd22
4 changed files with 42 additions and 4 deletions
+3
View File
@@ -430,6 +430,9 @@ func (a *agent) createTailnet(ctx context.Context, derpMap *tailcfg.DERPMap) (_
// runCoordinator runs a coordinator and returns whether a reconnect
// should occur.
func (a *agent) runCoordinator(ctx context.Context, network *tailnet.Conn) error {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
coordinator, err := a.client.ListenWorkspaceAgent(ctx)
if err != nil {
return err