From 1c549a87178cc82e7d9f92c6df9fdcd6d0a24c8d Mon Sep 17 00:00:00 2001 From: hwen Date: Mon, 3 Jan 2022 19:31:39 +0800 Subject: [PATCH] [local-app] fix timeout chan no consumer --- components/local-app/pkg/bastion/bastion.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/local-app/pkg/bastion/bastion.go b/components/local-app/pkg/bastion/bastion.go index 29c5d7e3671c20..e570e0808392ea 100644 --- a/components/local-app/pkg/bastion/bastion.go +++ b/components/local-app/pkg/bastion/bastion.go @@ -391,13 +391,17 @@ func (b *Bastion) handleUpdate(ur *WorkspaceUpdateRequest) { ws.cancel() delete(b.workspaces, u.ID) b.Callbacks.InstanceUpdate(ws) - b.workspaceMapChangeChan <- len(b.workspaces) + if b.localAppTimeout != 0 { + b.workspaceMapChangeChan <- len(b.workspaces) + } return } b.workspaces[u.ID] = ws b.Callbacks.InstanceUpdate(ws) - b.workspaceMapChangeChan <- len(b.workspaces) + if b.localAppTimeout != 0 { + b.workspaceMapChangeChan <- len(b.workspaces) + } } func generateSSHKeys(instanceID string) (privateKeyFN string, publicKey string, err error) {