@@ -93,13 +93,19 @@ func (cmd *Cmd) Start() error {
9393 return nil
9494}
9595
96- // RegisterGracefullyShutdown registers a graceful shutdown for the command in two ways:
97- // 1. If the context cancel contains a cause with a signal, this means that Terragrunt received the signal from the OS,
98- // since our executed command may also receive the same signal, we need to give the command time to gracefully shutting down,
99- // to avoid the command receiving this signal twice.
100- // Thus we will send the signal to the executed command with a delay or immediately if Terragrunt receives this same signal again.
101- // 2. If the context does not contain any causes, this means that there was some failure and we need to terminate all executed commands,
102- // in this situation we are sure that commands did not receive any signal, so we send them an interrupt signal immediately.
96+ // RegisterGracefullyShutdown registers a graceful shutdown for the
97+ // command in two ways:
98+ // 1. If the context cancel contains a cause with a signal, this means
99+ // that Terragrunt received the signal from the OS, since our
100+ // executed command may also receive the same signal, we need to
101+ // give the command time to gracefully shutting down, to avoid the
102+ // command receiving this signal twice. Thus we will send the signal
103+ // to the executed command with a delay or immediately if Terragrunt
104+ // receives this same signal again.
105+ // 2. If the context does not contain any causes, this means that there
106+ // was some failure and we need to terminate all executed commands,
107+ // in this situation we are sure that commands did not receive any
108+ // signal, so we send them an interrupt signal immediately.
103109func (cmd * Cmd ) RegisterGracefullyShutdown (ctx context.Context ) func () {
104110 cmd .gracefulShutdownRegistered .Store (true )
105111
0 commit comments