Skip to content

Commit

Permalink
fix: use reboot delay only in case of error
Browse files Browse the repository at this point in the history
Delay the reboot for 10 seconds only if Talos hits an error, but
otherwise just proceed with the requested action.

This removes 10 seconds on "regular" reboot without kexec.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Apr 26, 2024
1 parent 05fd042 commit 98906ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/app/machined/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ func handle(ctx context.Context, err error) {
rebootCmd = 0
}
}
}

if rebootCmd == unix.LINUX_REBOOT_CMD_RESTART {
for i := 10; i >= 0; i-- {
log.Printf("rebooting in %d seconds\n", i)
time.Sleep(1 * time.Second)
if rebootCmd == unix.LINUX_REBOOT_CMD_RESTART {
for i := 10; i >= 0; i-- {
log.Printf("rebooting in %d seconds\n", i)
time.Sleep(1 * time.Second)
}
}
}

Expand Down

0 comments on commit 98906ed

Please sign in to comment.