From 892e5f41953953dd5d02e0ae1512b12861c497a3 Mon Sep 17 00:00:00 2001 From: Siyuan Date: Tue, 18 Nov 2025 16:15:47 +0000 Subject: [PATCH] chore: reduce reboot delay to 3 seconds --- internal/ota/ota.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/ota/ota.go b/internal/ota/ota.go index d077dc02..ab5386e0 100644 --- a/internal/ota/ota.go +++ b/internal/ota/ota.go @@ -282,7 +282,10 @@ func (s *State) doUpdate(ctx context.Context, params UpdateParams) error { RedirectTo: redirectUrl, } - if err := s.reboot(true, postRebootAction, 10*time.Second); err != nil { + // REBOOT_REDIRECT_DELAY_MS is 5 seconds in the UI, + // it means that healthCheckUrl will be called after 5 seconds that we send willReboot JSONRPC event + // so we need to reboot it within 5 seconds to avoid it being called before the device is rebooted + if err := s.reboot(true, postRebootAction, 3*time.Second); err != nil { return s.componentUpdateError("Error requesting reboot", err, &scopedLogger) } }