转发运行事件时跳过不认识的事件种类(回放照样读得到);test-multiprocess.sh 不带参数时 macOS 的 bash 3.2 报 args 未定义,参数直接原样交给 pytest

This commit is contained in:
ThearchyHelios
2026-10-19 12:30:30 +08:00
parent 09907b21f1
commit e6a3ee8f95
2 changed files with 7 additions and 5 deletions
+6 -3
View File
@@ -159,11 +159,14 @@ class Relay:
.order_by(RunEvent.seq))).scalars())
last_log = None
for row in rows:
event = RunEventModel(id=row.id, run_id=run_id, seq=row.seq, type=EventType(row.type),
node_id=row.node_id, ts=row.ts, data=row.data or {})
await bus.publish(event, relayed=True)
self._cursor[run_id] = max(self._cursor.get(run_id, 0), int(row.seq or 0))
last_log = row
try:
event = RunEventModel(id=row.id, run_id=run_id, seq=row.seq, type=EventType(row.type),
node_id=row.node_id, ts=row.ts, data=row.data or {})
except ValueError:
continue # 不认识的事件种类(更新的版本写的):回放时照样读得到,这里不转
await bus.publish(event, relayed=True)
ended = status is None or status in _TERMINAL or (
status == "interrupted" and last_log is not None and last_log.type == EventType.LOG
and (last_log.data or {}).get("code") == "server_shutdown")