Cleaner server shutdowns:

- Remove a workaround for Sanic server not always terminating cleanly
- Terminate worker threads before server stop
- Silent closing of watching WebSocket attempted to open while shutting down
This commit is contained in:
Leo Vasanko
2025-08-17 08:15:01 -06:00
parent 26addb2f7b
commit 33db2c01b4
4 changed files with 12 additions and 15 deletions
+2 -2
View File
@@ -440,7 +440,7 @@ def watcher_poll(loop):
quit.wait(0.1 + 8 * dur)
async def start(app, loop):
def start(app, loop):
global rootpath
config.load_config()
rootpath = config.config.path
@@ -454,6 +454,6 @@ async def start(app, loop):
app.ctx.watcher.start()
async def stop(app, loop):
def stop(app):
quit.set()
app.ctx.watcher.join()