Merge remote-tracking branch 'origin/fix/core-sigint-before-app' into validation/test-build-with-fixes

This commit is contained in:
huanghuoguoguo
2026-05-16 10:55:07 +08:00
2 changed files with 67 additions and 1 deletions

View File

@@ -46,12 +46,14 @@ async def make_app(loop: asyncio.AbstractEventLoop) -> app.Application:
async def main(loop: asyncio.AbstractEventLoop):
app_inst: app.Application | None = None
try:
# Hang system signal processing
import signal
def signal_handler(sig, frame):
app_inst.dispose()
if app_inst is not None:
app_inst.dispose()
print('[Signal] Program exit.')
os._exit(0)