ops: math-fix watcher grep per-run output, not cumulative log (cumulative grep re-matched first queue-busy -> 173-iteration relaunch loop, passes 4-58 no-ops)

This commit is contained in:
krisf committed 2026-10-09 20:52:45 -04:00
1 parent e9e0bb23b0
commit 8f2f5cf163
1 file changed
+5 -2
+5 -2
View File
@@ -8,9 +8,12 @@ for i in $(seq 1 240); do
if pgrep -f "dsh-run" >/dev/null; then sleep 60; continue; fi
if ! git diff --quiet || [ -n "$(git status --porcelain --untracked-files=normal | grep -v '^?? ')" ]; then sleep 60; continue; fi
echo "[watcher] launching math-fix job (iteration $i)" | tee -a "$LOG"
~/.local/bin/dsh-run /home/ubuntu/projects/retire-planner "$PROMPT" >> "$LOG" 2>&1
RUNLOG=$(mktemp /tmp/math-fix-run.XXXXXX)
~/.local/bin/dsh-run /home/ubuntu/projects/retire-planner "$PROMPT" > "$RUNLOG" 2>&1
rc=$?
if grep -q "DSH_QUEUE_BUSY" "$LOG"; then echo "[watcher] queue busy, retrying" | tee -a "$LOG"; sleep 60; continue; fi
cat "$RUNLOG" >> "$LOG"
if grep -q "DSH_QUEUE_BUSY" "$RUNLOG"; then echo "[watcher] queue busy, retrying" | tee -a "$LOG"; rm -f "$RUNLOG"; sleep 60; continue; fi
rm -f "$RUNLOG"
echo "[watcher] math-fix job finished rc=$rc" | tee -a "$LOG"
exit $rc
done