Skip to content

Commit

Permalink
Revert "Load app before setting LIGHTNING_DISPATCHED (#16057)"
Browse files Browse the repository at this point in the history
This reverts commit 8d3339a.
  • Loading branch information
akihironitta committed Dec 15, 2022
1 parent 6745531 commit fc8dab3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lightning_app/runners/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def dispatch(
from lightning_app.runners.runtime_type import RuntimeType
from lightning_app.utilities.component import _set_flow_context

# Used to indicate Lightning has been dispatched
os.environ["LIGHTNING_DISPATCHED"] = "1"

_set_flow_context()

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

0 comments on commit fc8dab3

Please sign in to comment.