From e7614d2e8e9739fd81305f688d27c49e9e7b54d8 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Fri, 13 Sep 2024 09:35:38 +0800 Subject: [PATCH] rerun idle kernel on finish --- src/runtime/src/comms.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index 5d459b13..c9483eca 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -837,16 +837,18 @@ pub fn main(timer: GlobalTimer, cfg: Config) { can_restart_idle.signal(); match maybe_idle_kernel { Some(buffer) => { - info!("loading idle kernel"); - match handle_flash_kernel(&buffer, &control, &up_destinations, &aux_mutex, &routing_table, timer).await { - Ok(_) => { - info!("running idle kernel"); - match handle_run_kernel(None, &control, &up_destinations, &aux_mutex, &routing_table, timer).await { - Ok(_) => info!("idle kernel finished"), - Err(_) => warn!("idle kernel running error") - } - }, - Err(_) => warn!("idle kernel loading error") + loop { + info!("loading idle kernel"); + match handle_flash_kernel(&buffer, &control, &up_destinations, &aux_mutex, &routing_table, timer).await { + Ok(_) => { + info!("running idle kernel"); + match handle_run_kernel(None, &control, &up_destinations, &aux_mutex, &routing_table, timer).await { + Ok(_) => info!("idle kernel finished"), + Err(_) => warn!("idle kernel running error") + } + }, + Err(_) => warn!("idle kernel loading error") + } } }, None => info!("no idle kernel found")