Skip to content

Commit 711b1af

Browse files
committed
Explain why function is called twice
1 parent a776dc5 commit 711b1af

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shiny/express/_run.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ def set_result(x: object):
9999
var_context,
100100
)
101101

102+
# When we called the function to get the top level recall context manager, we didn't
103+
# store the result in a variable and re-use that variable here. That is intentional,
104+
# because during the evaluation of the app code,
105+
# replace_top_level_recall_context_manager() may have been called, which swaps
106+
# out the context manager, and it's the new one that we need to exit here.
102107
get_top_level_recall_context_manager().__exit__(None, None, None)
103108

104109
# If we're running as an Express app but there's also a top-level item named app

0 commit comments

Comments
 (0)