7313c8a4435354e5d8a8f6ddb5242f78f22dbfbb
修「开始生成→几秒后停止→两个按钮都灰几十秒像卡死」:非死锁,是温和停止 在等当前目录行收尾,而 _generate_directory_outfit 一次性 submit 全部图片、 shutdown(wait=True) 等全跑完,停止信号进不到该循环;且 _stop 后无反馈。 - outfit_batch:run() 经 _accepts_should_stop 给 generate_func 传 should_stop (= _stop_event.is_set),2-arg 才传、1-arg 仍兼容(含既有 mock) - ai_outfit:generate_outfit_image/_generate_directory_outfit 增 should_stop; 目录循环改有界提交——始终最多 image_concurrency 张在飞,每张完成后、提交 下一张前查 should_stop,已停止则停止提交、在飞收尾即返回(结果注明 「已停止,N 张未生成」,已生成的带 output_paths) - 面板:_OutfitWorker.gen(task, should_stop) 透传;_stop() 把停止按钮改 「停止中…」;_set_running(False) 复位「停止生成」 测试:目录行 should_stop 触发后只生成到停止点、返回「已停止」结果;2-arg generate_func 收到 should_stop;既有用例(1-arg mock、目录并发/部分失败)保持绿。 全套 py37 通过(test_config_service 的 packaging 模板失败属并行 §19.13,无关)。 离屏冒烟:stop 截断 run 且 runner 及时返回;面板停止按钮「停止中…」→结束复位。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cmbot
自动化图生图
Languages
Python
98.5%
PowerShell
1.5%