feat: 添加任务管理模块

This commit is contained in:
Junyan Qin
2024-10-22 18:09:18 +08:00
parent 26770439bb
commit c151665419
10 changed files with 121 additions and 36 deletions

View File

@@ -49,6 +49,16 @@ async def make_app(loop: asyncio.AbstractEventLoop) -> app.Application:
async def main(loop: asyncio.AbstractEventLoop):
try:
# 挂系统信号处理
import signal
def signal_handler(sig, frame):
print("[Signal] 程序退出.")
os._exit(0)
signal.signal(signal.SIGINT, signal_handler)
app_inst = await make_app(loop)
await app_inst.run()
except Exception as e: