渲染机看门狗按分辨率放宽 + 静默检测;开单后台 Windows 下禁止双开
- ys_worker: 总时长上限随分辨率放宽(1000→600s,4096→~84min),另加 900s 无输出判卡死; 超时时把 Blender 最后几行输出写进日志。修复空艇 4096 每次在第 10 分钟被误杀(订单 YSPPVNXQ)。 - ys_worker: 读输出改为按字节 read1 + 增量解码,文本模式 read(512) 会攒满才返回。 - ys_local: 本机单同样按分辨率给上限。 - ys_admin: Windows 上关闭 SO_REUSEADDR —— 否则再双击会起第二个实例绑同一端口(宿主机实测复现)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1071,6 +1071,13 @@ class H(BaseHTTPRequestHandler):
|
||||
"codes": (cd.get("codes") if ok3 else []) or []})
|
||||
|
||||
|
||||
class _Server(ThreadingHTTPServer):
|
||||
# ⚠️ 2026-10-07 实测:HTTPServer 默认开 SO_REUSEADDR,**Windows 上这等于允许两个进程绑同一个端口**——
|
||||
# 金钻再双击一次「开单后台」,第二个实例照样起来了(没走"已经有一个在跑"分支),两个面板并存。
|
||||
# Windows 上关掉它,第二个实例 bind 就会失败 → 只开浏览器。Linux 上留着(重启时不用等 TIME_WAIT)。
|
||||
allow_reuse_address = (os.name != "nt")
|
||||
|
||||
|
||||
def single_instance():
|
||||
s = socket.socket()
|
||||
try:
|
||||
@@ -1091,7 +1098,7 @@ def main():
|
||||
# 两个地址在同一个端口上会 EADDRINUSE(2026-09-30 自测实踩)。
|
||||
# 直接起服务:起不来就说明已经有一个在跑,开个浏览器就完事。
|
||||
try:
|
||||
srv = ThreadingHTTPServer(("<ALL-INTERFACES>", PORT), H) # <ALL-INTERFACES> = 局域网(手机同 WiFi 也能开)
|
||||
srv = _Server(("<ALL-INTERFACES>", PORT), H) # <ALL-INTERFACES> = 局域网(手机同 WiFi 也能开)
|
||||
except OSError:
|
||||
log("已经有一个开单后台在跑了%s" % (",这次只开浏览器" if OPEN_BROWSER else ",这次什么都不做"))
|
||||
if OPEN_BROWSER:
|
||||
|
||||
Reference in New Issue
Block a user