Skip to content

Commit

Permalink
raise exception when ui.shutdown is called with auto-reload activated
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Sep 13, 2022
1 parent 6ff3b31 commit 8d11d74
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nicegui/lifecycle.py
Expand Up @@ -22,6 +22,8 @@ def on_shutdown(self, handler: Union[Callable, Awaitable]):


async def shutdown(self) -> None:
if globals.config.reload:
raise Exception('ui.shutdown is not supported when auto-reload is enabled')
for socket in [s for page in jp.WebPage.sockets.values() for s in page.values()]:
await socket.close()
globals.server.should_exit = True

0 comments on commit 8d11d74

Please sign in to comment.