修复bug
This commit is contained in:
@@ -203,8 +203,8 @@ def watchLiveForGrowth():
|
|||||||
def stopScript():
|
def stopScript():
|
||||||
body = request.get_json()
|
body = request.get_json()
|
||||||
udid = body.get("udid")
|
udid = body.get("udid")
|
||||||
ThreadManager.stop(udid)
|
code, msg = ThreadManager.stop(udid)
|
||||||
return ResultData(data="").toJson()
|
return ResultData(code=code, data="", msg=msg).toJson()
|
||||||
|
|
||||||
|
|
||||||
# 传递主播数据
|
# 传递主播数据
|
||||||
|
|||||||
@@ -17,12 +17,17 @@ class ThreadManager():
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def stop(cls, udid):
|
def stop(cls, udid):
|
||||||
print(cls.threads)
|
try:
|
||||||
info = cls.threads[udid]
|
info = cls.threads[udid]
|
||||||
if info:
|
if info:
|
||||||
info["stopEvent"].set() # 停止线程
|
info["stopEvent"].set() # 停止线程
|
||||||
info["thread"].join(timeout=3) # 等待线程退出
|
info["thread"].join(timeout=3) # 等待线程退出
|
||||||
del cls.threads[udid]
|
del cls.threads[udid]
|
||||||
LogManager.info("停止线程成功", udid)
|
LogManager.info("停止线程成功", udid)
|
||||||
|
return 200, "停止线程成功 " + udid
|
||||||
else:
|
else:
|
||||||
LogManager.info("无此线程,无需关闭", udid)
|
LogManager.info("无此线程,无需关闭", udid)
|
||||||
|
return 1001, "无此线程,无需关闭 " + udid
|
||||||
|
except KeyError as e:
|
||||||
|
LogManager.info("无此线程,无需关闭", udid)
|
||||||
|
return 1001, "停止脚本失败 " + udid
|
||||||
@@ -198,6 +198,9 @@ class ScriptManager():
|
|||||||
# 点击搜索按钮
|
# 点击搜索按钮
|
||||||
ControlUtils.clickSearch(session)
|
ControlUtils.clickSearch(session)
|
||||||
|
|
||||||
|
# 创建udid名称的目录
|
||||||
|
AiUtils.makeUdidDir(udid)
|
||||||
|
|
||||||
# 返回上一步
|
# 返回上一步
|
||||||
def goBack(count):
|
def goBack(count):
|
||||||
for i in range(count):
|
for i in range(count):
|
||||||
|
|||||||
Reference in New Issue
Block a user