From ae3b2b7628ee5a593dd495d82b5f62c070279f9f Mon Sep 17 00:00:00 2001 From: Siyuan Date: Tue, 18 Nov 2025 14:48:39 +0000 Subject: [PATCH] fix(hwReboot): only wait for extra settle time if delay is greater than 1 second --- hw.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw.go b/hw.go index 0a62d606..505ff698 100644 --- a/hw.go +++ b/hw.go @@ -40,13 +40,15 @@ func readOtpEntropy() ([]byte, error) { //nolint:unused } func hwReboot(force bool, postRebootAction *ota.PostRebootAction, delay time.Duration) error { - logger.Info().Msgf("Reboot requested, rebooting in %d seconds...", delay) + logger.Info().Dur("delay", delay).Msg("reboot requested") writeJSONRPCEvent("willReboot", postRebootAction, currentSession) time.Sleep(1 * time.Second) // Wait for the JSONRPCEvent to be sent nativeInstance.SwitchToScreenIfDifferent("rebooting_screen") - time.Sleep(delay - (1 * time.Second)) // wait requested extra settle time + if delay > 1*time.Second { + time.Sleep(delay - 1*time.Second) // wait requested extra settle time + } args := []string{} if force {