Skip to content

Commit

Permalink
Defer stream closure for status observance
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek committed Nov 7, 2023
1 parent a24f72d commit ffa3606
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/local-app/cmd/workspace-stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ var workspaceStopCommand = &cobra.Command{
return err
}

defer stream.Close()

slog.Info("waiting for workspace to stop...")

previousStatus := ""
Expand Down
2 changes: 2 additions & 0 deletions components/local-app/pkg/helper/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ func ObserveWorkspaceUntilStarted(ctx context.Context, clnt *client.Gitpod, work
continue
}

defer stream.Close()

for stream.Receive() {
msg := stream.Msg()
if msg == nil {
Expand Down

0 comments on commit ffa3606

Please sign in to comment.