Skip to content

Commit

Permalink
Run onload callbacks with --warm option (#2844)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 4, 2021
1 parent 2a46a6b commit 1dc1224
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion panel/command/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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 @@ -188,10 +188,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)

config.session_history = args.session_history
Expand Down

0 comments on commit 1dc1224

Please sign in to comment.