Skip to content

Commit 55a9e76

Browse files
committed
Stop acp on ctrl+c
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
1 parent 0cf3be6 commit 55a9e76

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

cmd/root/acp.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ func (f *acpFlags) runACPCommand(cmd *cobra.Command, args []string) error {
5858
defer acpAgent.Stop(ctx)
5959

6060
slog.Debug("acp started, waiting for conn")
61-
<-conn.Done()
62-
63-
return nil
61+
select {
62+
case <-ctx.Done():
63+
return ctx.Err()
64+
case <-conn.Done():
65+
return nil
66+
}
6467
}

0 commit comments

Comments
 (0)