Merge pull request #304 from hashicorp/close-ui

Close UI if it is close-able
This commit is contained in:
Sophia Castellarin 2022-07-07 16:18:08 -05:00 committed by GitHub
commit 1bc4c4be7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,7 +221,7 @@ func (r *Runner) accept(ctx context.Context, id string) error {
// ensure that no more output is writting to the client.
log.Info("starting job execution")
result, err = r.executeJob(ctx, log, ui, assignment.Assignment.Job, wd)
if ui, ok := ui.(*runnerUI); ok {
if ui, ok := ui.(io.Closer); ok {
ui.Close()
}
log.Debug("job finished", "error", err)