修复bug

This commit is contained in:
zw
2025-08-14 14:46:52 +08:00
parent f3fe7a661f
commit 6747de733a
3 changed files with 19 additions and 11 deletions

View File

@@ -203,8 +203,8 @@ def watchLiveForGrowth():
def stopScript():
body = request.get_json()
udid = body.get("udid")
ThreadManager.stop(udid)
return ResultData(data="").toJson()
code, msg = ThreadManager.stop(udid)
return ResultData(code=code, data="", msg=msg).toJson()
# 传递主播数据

View File

@@ -17,12 +17,17 @@ class ThreadManager():
@classmethod
def stop(cls, udid):
print(cls.threads)
info = cls.threads[udid]
if info:
info["stopEvent"].set() # 停止线程
info["thread"].join(timeout=3) # 等待线程退出
del cls.threads[udid]
LogManager.info("停止线程成功", udid)
else:
try:
info = cls.threads[udid]
if info:
info["stopEvent"].set() # 停止线程
info["thread"].join(timeout=3) # 等待线程退出
del cls.threads[udid]
LogManager.info("停止线程成功", udid)
return 200, "停止线程成功 " + udid
else:
LogManager.info("无此线程,无需关闭", udid)
return 1001, "无此线程,无需关闭 " + udid
except KeyError as e:
LogManager.info("无此线程,无需关闭", udid)
return 1001, "停止脚本失败 " + udid

View File

@@ -198,6 +198,9 @@ class ScriptManager():
# 点击搜索按钮
ControlUtils.clickSearch(session)
# 创建udid名称的目录
AiUtils.makeUdidDir(udid)
# 返回上一步
def goBack(count):
for i in range(count):