Skip to content

Commit 15b06c4

Browse files
akihironittaawaelchli
authored andcommitted
Revert "Load app before setting LIGHTNING_DISPATCHED" (#16064)
Revert "Load app before setting LIGHTNING_DISPATCHED (#16057)" This reverts commit 8d3339a.
1 parent eb4693f commit 15b06c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lightning_app/runners/runtime.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def dispatch(
5555
from lightning_app.runners.runtime_type import RuntimeType
5656
from lightning_app.utilities.component import _set_flow_context
5757

58+
# Used to indicate Lightning has been dispatched
59+
os.environ["LIGHTNING_DISPATCHED"] = "1"
60+
5861
_set_flow_context()
5962

6063
runtime_type = RuntimeType(runtime_type)
@@ -77,8 +80,6 @@ def dispatch(
7780
secrets=secrets,
7881
run_app_comment_commands=run_app_comment_commands,
7982
)
80-
# Used to indicate Lightning has been dispatched
81-
os.environ["LIGHTNING_DISPATCHED"] = "1"
8283
# a cloud dispatcher will return the result while local
8384
# dispatchers will be running the app in the main process
8485
return runtime.dispatch(open_ui=open_ui, name=name, no_cache=no_cache, cluster_id=cluster_id)

0 commit comments

Comments
 (0)