This commit is contained in:
2025-11-29 11:46:09 +08:00
parent a7aae4c4c9
commit 04cebde584
2 changed files with 9 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
# 0.2.1
- 修复自动化代码 处理异常情况
# 0.2.0
- 优化自动化代码 提高容错
# 0.1.9

View File

@@ -760,7 +760,8 @@ def main():
time.sleep(secs)
continue
with ThreadPoolExecutor(max_workers=len(proxies)) as executor:
executor = ThreadPoolExecutor(max_workers=len(proxies))
try:
futures_map = {executor.submit(proxy_loop, p, stop_event): p for p in proxies}
monitor_thread = threading.Thread(
@@ -778,7 +779,6 @@ def main():
except Exception:
pass
break
# 进入禁跑时段时,立即停止并清理浏览器
if is_forbidden_time():
logger.info("进入禁跑时段,停止当前批次并清理指纹浏览器")
stop_event.set()
@@ -806,6 +806,11 @@ def main():
monitor_thread.join(timeout=5)
except Exception:
pass
finally:
try:
executor.shutdown(wait=False)
except Exception:
pass
continue