Skip to content

Commit

Permalink
Run onload callbacks with --warm option
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 21, 2021
1 parent d898ae6 commit 47c9240
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 @@ -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

0 comments on commit 47c9240

Please sign in to comment.