Skip to content

Commit 42a82af

Browse files
nervghalexey-igrychev
authored andcommitted
fix(build, compose, run, kube-run, plan): respect graceful shutdown in follow mode
Signed-off-by: Alexandr Zaytsev <alexandr.zaytsev@flant.com>
1 parent d08d497 commit 42a82af

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/werf/common/follow.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"time"
77

8+
"github.com/werf/common-go/pkg/graceful"
89
"github.com/werf/logboek"
910
"github.com/werf/logboek/pkg/style"
1011
"github.com/werf/logboek/pkg/types"
@@ -55,6 +56,10 @@ func FollowGitHead(ctx context.Context, cmdData *CmdData, taskFunc func(ctx cont
5556

5657
for {
5758
if err := iterFunc(); err != nil {
59+
if graceful.IsTerminating(ctx) {
60+
return ctx.Err()
61+
}
62+
5863
logboek.Context(ctx).Warn().LogLn(err)
5964
logboek.Context(ctx).LogLn(waitMessage)
6065
logboek.Context(ctx).LogOptionalLn()

0 commit comments

Comments
 (0)