Files
admin 34c4effc82 feat(dag): 真实多用户隔离运行 + SSE 自愈 + 面板默认 headless 防 OOM
- 各泳道真实参与方账号独立登录,每泳道 newContext() 缓存隔离

- SSE send() 吞客户端断开错误,避免污染服务端批次

- running 标志自愈 + finally 先释放,浏览器清理带超时

- 面板 open 默认 false,避免本机低内存 OOM 杀主浏览器与 BE

- 新增 run_and_wait.mjs / trigger_run.mjs 触发+前台轮询

- 权限守卫机制与多用户根因沉淀;精简 MEMORY.md 至 3000 字符
2026-08-10 15:18:00 +08:00

23 lines
979 B
JavaScript

// 触发 DAG 批次:拿到 runId 立即断开,服务端独立跑;结果写 results/dag-runs/<runId>.json
import http from 'node:http'
const seq = process.argv[2] || 'seq-1'
const body = JSON.stringify({ seq, open: false })
const req = http.request(
{ host: '127.0.0.1', port: 7789, path: '/api/run', method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body) } },
(res) => {
let buf = ''
res.on('data', (d) => {
buf += d
const m = buf.match(/runId["']?\s*[:]\s*["']?([A-Za-z0-9\-]+)/)
if (m && !global.__printed) { global.__printed = 1; console.log('TRIGGERED runId=' + m[1]) }
})
res.on('end', () => { console.log('SSE closed (server continues)'); process.exit(0) })
}
)
req.on('error', (e) => { console.log('TRIGGER_FAIL', e.message); process.exit(1) })
req.write(body)
req.end()
setTimeout(() => { console.log('timeout disconnecting (server continues)'); process.exit(0) }, 15000)