Skip to content

Commit

Permalink
Do not error on autoreload shutdown (#6940)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Jun 27, 2024
1 parent d06c1f2 commit 56d70c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion panel/io/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,10 @@ def stop(self, wait: bool = True) -> None:
async def stop_autoreload():
self._autoreload_stop_event.set()
await self._autoreload_task
self._loop.asyncio_loop.run_until_complete(stop_autoreload())
try:
self._loop.asyncio_loop.run_until_complete(stop_autoreload())
except RuntimeError:
pass # Ignore if the event loop is still running
super().stop(wait=wait)
if state._admin_context:
state._admin_context.run_unload_hook()
Expand Down

0 comments on commit 56d70c1

Please sign in to comment.