chore: reduce reboot delay to 3 seconds

This commit is contained in:
Siyuan 2025-11-18 16:15:47 +00:00
parent b8af39cae9
commit 892e5f4195
1 changed files with 4 additions and 1 deletions

View File

@ -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)
}
}