临时提交
This commit is contained in:
5
.idea/workspace.xml
generated
5
.idea/workspace.xml
generated
@@ -5,12 +5,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="eceeff5e-51c1-459c-a911-d21ec090a423" name="Changes" comment="20250904-初步功能已完成">
|
<list default="true" id="eceeff5e-51c1-459c-a911-d21ec090a423" name="Changes" comment="20250904-初步功能已完成">
|
||||||
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Module/FlaskService.py" beforeDir="false" afterPath="$PROJECT_DIR$/Module/FlaskService.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Utils/AiUtils.py" beforeDir="false" afterPath="$PROJECT_DIR$/Utils/AiUtils.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Utils/ThreadManager.py" beforeDir="false" afterPath="$PROJECT_DIR$/Utils/ThreadManager.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/script/ScriptManager.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ScriptManager.py" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ class ThreadManager:
|
|||||||
|
|
||||||
with ThreadPoolExecutor(max_workers=min(32, len(udids))) as executor:
|
with ThreadPoolExecutor(max_workers=min(32, len(udids))) as executor:
|
||||||
future_map = {executor.submit(cls.stop, udid): udid for udid in udids}
|
future_map = {executor.submit(cls.stop, udid): udid for udid in udids}
|
||||||
|
|
||||||
for future in as_completed(future_map):
|
for future in as_completed(future_map):
|
||||||
udid = future_map[future]
|
udid = future_map[future]
|
||||||
try:
|
try:
|
||||||
@@ -90,7 +89,6 @@ class ThreadManager:
|
|||||||
fail_list.append(f"设备{udid}停止失败:{reason}")
|
fail_list.append(f"设备{udid}停止失败:{reason}")
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
fail_list.append(f"设备{udid}停止异常:{exc}")
|
fail_list.append(f"设备{udid}停止异常:{exc}")
|
||||||
|
|
||||||
if fail_list:
|
if fail_list:
|
||||||
return 1001, fail_list, "停止失败"
|
return 1001, fail_list, "停止失败"
|
||||||
return 200, [], "全部设备停止成功"
|
return 200, [], "全部设备停止成功"
|
||||||
|
|||||||
@@ -31,14 +31,7 @@ class ScriptManager():
|
|||||||
self.initialized = True # 标记已初始化
|
self.initialized = True # 标记已初始化
|
||||||
|
|
||||||
# 养号
|
# 养号
|
||||||
def growAccount(self, udid, event, max_retries=None):
|
def growAccount(self, udid, event):
|
||||||
"""
|
|
||||||
自动养号方法,带重生机制
|
|
||||||
:param udid: 设备 UDID
|
|
||||||
:param event: 线程控制 Event
|
|
||||||
:param max_retries: 最大重试次数 (None 表示无限重试)
|
|
||||||
"""
|
|
||||||
retries = 10
|
|
||||||
|
|
||||||
while not event.is_set():
|
while not event.is_set():
|
||||||
try:
|
try:
|
||||||
@@ -141,7 +134,6 @@ class ScriptManager():
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LogManager.method_error(f"[{udid}] 养号出现异常,将重启流程: {e}", "养号", udid)
|
LogManager.method_error(f"[{udid}] 养号出现异常,将重启流程: {e}", "养号", udid)
|
||||||
retries += 1
|
|
||||||
time.sleep(3) # 等待后重生
|
time.sleep(3) # 等待后重生
|
||||||
|
|
||||||
# 观看直播
|
# 观看直播
|
||||||
|
|||||||
Reference in New Issue
Block a user