From a656cd076f67bdfdff8dfe3095292db6b44c96f8 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Tue, 7 Dec 2021 21:18:46 +0300 Subject: [PATCH] Terminal wrapper: exit on terminal expiration (#195) --- internal/executor/terminalwrapper/terminalwrapper.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/executor/terminalwrapper/terminalwrapper.go b/internal/executor/terminalwrapper/terminalwrapper.go index 992f8ed..6e82a5e 100644 --- a/internal/executor/terminalwrapper/terminalwrapper.go +++ b/internal/executor/terminalwrapper/terminalwrapper.go @@ -150,7 +150,9 @@ func (wrapper *Wrapper) Wait() chan Operation { }) if numActiveSessions == 0 { - break + wrapper.operationChan <- &ExitOperation{Success: true} + + return } message := fmt.Sprintf("Waited %.1f seconds, but there are still %d terminal sessions open "+ @@ -160,10 +162,10 @@ func (wrapper *Wrapper) Wait() chan Operation { continue case <-wrapper.ctx.Done(): - break - } + wrapper.operationChan <- &ExitOperation{Success: false} - wrapper.operationChan <- &ExitOperation{Success: true} + return + } } }()