chore(script): 更新波次闭环排查脚本抓取目标

tmp-trace-wave-closure-cause.cjs 改为在远端源码中定位 batchCancel 相关实现并打印上下文,
不再抓取历史日志片段
This commit is contained in:
liufumingren 2026-09-13 15:32:04 +08:00
parent 45e909fca0
commit 251d703c87

View File

@ -12,13 +12,12 @@ const WAVE_ID = '1777888535813505';
function buildRemoteScript() {
return [
'set -uo pipefail',
'D=/root/logs/wms/wms-web.log.2026-09-12',
'echo "===WRITES_AT_184428_CST==="',
'grep -a "2026-09-12 18:44:2[0-9]" "$D" 2>/dev/null | grep -a "wms_order_delivery_1000028" | cut -c1-420 | head -20 || true',
'echo "===WAVE_ID_CLEAR_STMTS_0912==="',
'grep -a "UPDATE .wms_order_delivery_1000028. SET .wave_id" "$D" 2>/dev/null | cut -c1-19 | uniq -c | head -30 || true',
'echo "===POST_METHODS_AT_162533==="',
'grep -a "2026-09-12 16:25:33" "$D" 2>/dev/null | grep -ao "POST /system?method=[a-zA-Z.]*" | sort | uniq -c | head -20 || true',
'F=/www/wwwroot/qimen/v2/app/service/systemMethods/order/wave.js',
'echo "===GREP_FUNCS==="',
'grep -n "async batchCancel\\|batchCancelWave\\|cancelSingleWave\\|wave_status = -1\\|wave_status: -1" "$F" 2>/dev/null | head -20 || true',
'echo "===SHOW_BATCHCANCEL_REGION==="',
'S=$(grep -n "async batchCancel(" "$F" | head -1 | cut -d: -f1)',
'if [ -n "$S" ]; then sed -n "${S},$((S+120))p" "$F"; fi',
].join('\n');
}