Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run onload callbacks with --warm option #2844

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion panel/command/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from ..config import config
from ..io.rest import REST_PROVIDERS
from ..io.reload import record_modules, watch
from ..io.server import INDEX_HTML, get_static_routes
from ..io.server import INDEX_HTML, get_static_routes, set_curdoc
from ..io.state import state

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -227,10 +227,14 @@ def customize_kwargs(self, args, server_kwargs):
with record_modules():
for app in applications.values():
doc = app.create_document()
with set_curdoc(doc):
state._on_load(None)
_cleanup_doc(doc)
else:
for app in applications.values():
doc = app.create_document()
with set_curdoc(doc):
state._on_load(None)
_cleanup_doc(doc)

prefix = args.prefix
Expand Down