MCPcopy
hub / github.com/666ghj/BettaFish / cleanup_processes

Function cleanup_processes

app.py:813–825  ·  view source on GitHub ↗

清理所有进程

()

Source from the content-addressed store, hash-verified

811 return False, "启动超时"
812
813def cleanup_processes():
814 """清理所有进程"""
815 _log_shutdown_step("开始串行清理子进程")
816 for app_name in STREAMLIT_SCRIPTS:
817 stop_streamlit_app(app_name)
818
819 processes['forum']['status'] = 'stopped'
820 try:
821 stop_forum_engine()
822 except Exception: # pragma: no cover
823 logger.exception("停止ForumEngine失败")
824 _log_shutdown_step("子进程清理完成")
825 _set_system_state(started=False, starting=False)
826
827def cleanup_processes_concurrent(timeout: float = 6.0):
828 """并发清理所有子进程,超时后强制杀掉残留进程。"""

Callers 2

app.pyFile · 0.85

Calls 4

_log_shutdown_stepFunction · 0.85
stop_streamlit_appFunction · 0.85
stop_forum_engineFunction · 0.85
_set_system_stateFunction · 0.85

Tested by

no test coverage detected