From 4522a29ec69436cd7d01db6d4e41142c3b1327c2 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 1 Jun 2026 22:47:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cleanup=5Fctx=E6=94=B9=E4=B8=BAon=5Fclea?= =?UTF-8?q?nup=EF=BC=8C=E4=BF=AE=E5=A4=8Dhot=5Freload=5Fcleanup=20coroutin?= =?UTF-8?q?e=E6=9C=AAawait=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cleanup_ctx要求异步上下文管理器(需yield),但_hot_reload_cleanup是普通async def。 改用on_cleanup接受普通coroutine function。 --- ahserver/configuredServer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ahserver/configuredServer.py b/ahserver/configuredServer.py index f8dac20..f4d5b3c 100644 --- a/ahserver/configuredServer.py +++ b/ahserver/configuredServer.py @@ -149,7 +149,7 @@ class ConfiguredServer: except asyncio.CancelledError: pass self.app.on_startup.append(_hot_reload_startup) - self.app.cleanup_ctx.append(_hot_reload_cleanup) + self.app.on_cleanup.append(_hot_reload_cleanup) print(f'hot_reload enabled, interval={interval}s, endpoint=GET /__hot_reload__') web.run_app(self.build_app(),host=config.website.host or '0.0.0.0',