dsh-qianchuan-toolkit 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## 1.0.15
|
|
4
|
+
|
|
5
|
+
- **修 dry-run 污染线上状态(真事故)**:`hourly.mjs --once --dry-run` 会往 `rounds.jsonl` 追加一条 `round:1` 记录,并把 `heartbeat.json` 覆盖成 `pid=本次进程, nextRound=0` —— 12:16 的回归测试就这么干了,看门狗 12:23 报了一次「🚨 巡航可能卡住」(**误报**)。现在 dry-run 完全不写心跳、不写 rounds(`writeHeartbeat` 首行 `if (DRY) return`;rounds 写入加 `if (!DRY)`),收尾日志也改成「完成(dry-run:不写 rounds/heartbeat…)」。已清理被污染的那条记录(`rounds.jsonl.bak-20261125-1226` 留底),心跳已按第 12 轮真实值恢复。
|
|
6
|
+
- 复测:dry-run 前后 `rounds.jsonl` 452 行不变、`heartbeat.json` mtime 不变。
|
|
3
7
|
## 1.0.14
|
|
4
8
|
|
|
5
9
|
- **统一浏览器启动器**:两个技能的 `scripts/start-qc.cmd` 现在逐字节相同 —— 先探 9222(已开则直接返回)→ 优先 Chrome、找不到再退 Edge → profile 统一 `%USERPROFILE%\qc-chrome` → 打开 `/login` 并等端口就绪(最多 40s)。修掉 live-control 旧启动器「打开 overall-prom 又不等待端口」的错位;仍是纯 ASCII + CRLF,双击不会闪退。
|
|
@@ -552,6 +552,7 @@ async function executeAccount(group, rec) {
|
|
|
552
552
|
// 心跳:每轮写入 heartbeat.json,看门狗据 nextAt 判断是否卡死
|
|
553
553
|
const HB_FILE = path.join(P.home, 'heartbeat.json')
|
|
554
554
|
function writeHeartbeat(o) {
|
|
555
|
+
if (DRY) return // dry-run 不写心跳:否则会把线上心跳覆盖成「下一轮=0」,看门狗必误报
|
|
555
556
|
try { fs.mkdirSync(P.home, { recursive: true }); fs.writeFileSync(HB_FILE, JSON.stringify({ ts: new Date().toISOString(), pid: process.pid, ...o })) } catch (e) { /* 心跳失败不影响巡航 */ }
|
|
556
557
|
}
|
|
557
558
|
function hourStartOf(t = Date.now()) { const d = new Date(t); d.setMinutes(0, 0, 0); return d.getTime() }
|
|
@@ -737,7 +738,7 @@ try {
|
|
|
737
738
|
for (const d of rec.decisions) if (d.decision.endAt) extras.push(new Date(d.decision.endAt).getTime() + 60000)
|
|
738
739
|
}
|
|
739
740
|
for (const rec of recs) { delete rec._group }
|
|
740
|
-
jl(P.rounds, { ts: new Date().toISOString(), round: i, ms: Date.now() - roundStart, accounts: recs })
|
|
741
|
+
if (!DRY) jl(P.rounds, { ts: new Date().toISOString(), round: i, ms: Date.now() - roundStart, accounts: recs })
|
|
741
742
|
writeHeartbeat({ round: i, ms: Date.now() - roundStart, nextAt: 0 })
|
|
742
743
|
log('本轮耗时 ' + ((Date.now() - roundStart) / 1000).toFixed(1) + 's')
|
|
743
744
|
const nodes = [...new Set(groups.flatMap((g) => g.targets.flatMap((t) => resolveRule(cfg, t).nodes)))].sort((a, b) => a - b)
|
|
@@ -789,4 +790,4 @@ try {
|
|
|
789
790
|
} finally {
|
|
790
791
|
for (const p of pageByKey.values()) p.close() // 只断 WS,标签页留着给下一轮/下一账号用
|
|
791
792
|
}
|
|
792
|
-
log('完成。埋点:' + P.rounds)
|
|
793
|
+
log(DRY ? '完成(dry-run:不写 rounds/heartbeat,不影响线上心跳)' : '完成。埋点:' + P.rounds)
|