File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ def run(self) -> None:
5858 ],
5959 env = env ,
6060 )
61+ self ._process .wait ()
6162
6263 def on_exit (self ) -> None :
6364 if self ._process is not None :
Original file line number Diff line number Diff line change @@ -526,14 +526,11 @@ def _update_layout(self) -> None:
526526 component ._layout = layout
527527
528528 def _update_is_headless (self ) -> None :
529- is_headless = _is_headless (self )
529+ self . is_headless = _is_headless (self )
530530
531531 # If `is_headless` changed, handle it.
532532 # This ensures support for apps which dynamically add a UI at runtime.
533- if self .is_headless != is_headless :
534- self .is_headless = is_headless
535-
536- _handle_is_headless (self )
533+ _handle_is_headless (self )
537534
538535 def _apply_restarting (self ) -> bool :
539536 self ._reset_original_state ()
Original file line number Diff line number Diff line change 1919
2020import websockets
2121from deepdiff import Delta
22- from lightning_cloud .openapi import AppinstancesIdBody , Externalv1LightningappInstance
22+ from lightning_cloud .openapi import AppinstancesIdBody , Externalv1LightningappInstance , V1LightningappInstanceState
2323
2424import lightning_app
2525from lightning_app .utilities .exceptions import LightningAppStateException
@@ -556,7 +556,12 @@ def _handle_is_headless(app: "LightningApp"):
556556 "App was not found. Please open an issue at https://github.com/lightning-AI/lightning/issues."
557557 )
558558
559- if current_lightningapp_instance .spec .is_headless == app .is_headless :
559+ if any (
560+ [
561+ current_lightningapp_instance .spec .is_headless == app .is_headless ,
562+ current_lightningapp_instance .status .phase != V1LightningappInstanceState .RUNNING ,
563+ ]
564+ ):
560565 return
561566
562567 current_lightningapp_instance .spec .is_headless = app .is_headless
You can’t perform that action at this time.
0 commit comments