Explorar o código

fix: loop panic on process exit in serve

Jonathan Kelley hai 5 meses
pai
achega
2c6a5212fc
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      packages/cli/src/serve/runner.rs

+ 8 - 2
packages/cli/src/serve/runner.rs

@@ -66,7 +66,10 @@ impl AppRunner {
             },
             Some(status) = OptionFuture::from(handle.app_child.as_mut().map(|f| f.wait())) => {
                 match status {
-                    Ok(status) => ProcessExited { status, platform },
+                    Ok(status) => {
+                        handle.app_child = None;
+                        ProcessExited { status, platform }
+                    },
                     Err(_err) => todo!("handle error in process joining?"),
                 }
             }
@@ -78,7 +81,10 @@ impl AppRunner {
             },
             Some(status) = OptionFuture::from(handle.server_child.as_mut().map(|f| f.wait())) => {
                 match status {
-                    Ok(status) => ProcessExited { status, platform },
+                    Ok(status) => {
+                        handle.server_child = None;
+                        ProcessExited { status, platform }
+                    },
                     Err(_err) => todo!("handle error in process joining?"),
                 }
             }