[object Object]

← back to Re Flyer Aggregator

TK-11856 rc-propagation (RSYNC): dtt-import + property-flyers propagate step/crawl/rsync rc

8e714b12cb3fa0f38af7fcef1f982095e95011d5 · 2026-09-26 09:22:34 -0700 · Steve

Exit-code ONLY, no behavior change (Steve ruling 2026-09-26 Q1/Q2): every step still runs as
before; the wrapper now exits with the first nonzero rc of its side-effecting step(s) instead of
swallowing it, so cron-fire-canary's exit corroboration can see a failed run. No heartbeat file added.
Revert: git -C /Users/macstudio3/Projects/re-flyer-aggregator revert <this sha>

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YaiWjfgEuKQLTb5cdDreS3

Files touched

Diff

commit 8e714b12cb3fa0f38af7fcef1f982095e95011d5
Author: Steve <steve@designerwallcoverings.com>
Date:   Sat Sep 26 09:22:34 2026 -0700

    TK-11856 rc-propagation (RSYNC): dtt-import + property-flyers propagate step/crawl/rsync rc
    
    Exit-code ONLY, no behavior change (Steve ruling 2026-09-26 Q1/Q2): every step still runs as
    before; the wrapper now exits with the first nonzero rc of its side-effecting step(s) instead of
    swallowing it, so cron-fire-canary's exit corroboration can see a failed run. No heartbeat file added.
    Revert: git -C /Users/macstudio3/Projects/re-flyer-aggregator revert <this sha>
    
    Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01YaiWjfgEuKQLTb5cdDreS3
---
 scripts/dtt-cron.sh             | 16 +++++++++++++++-
 scripts/property-flyers-cron.sh | 12 ++++++++++--
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/scripts/dtt-cron.sh b/scripts/dtt-cron.sh
index f340222..de047d1 100755
--- a/scripts/dtt-cron.sh
+++ b/scripts/dtt-cron.sh
@@ -4,18 +4,32 @@ export PATH="/opt/homebrew/bin:/opt/homebrew/opt/postgresql@14/bin:/usr/bin:/bin
 cd "$(dirname "$0")/.." || exit 1
 LOG="data/dtt-cron.log"; mkdir -p data out
 echo "=== $(date '+%Y-%m-%d %H:%M:%S') daily run ===" >> "$LOG"
+# TK-11856 rc-propagation (exit-code ONLY, no behavior change): every step still runs in order even
+# if an earlier one fails (no set -e, exactly as before); we only REMEMBER the first nonzero rc of a
+# step (incl. the George digest send + both Kamatera pushes) and exit with it at the end, instead of
+# the closing echo's 0. Undo: git revert.
+FIRST_RC=0
+note_rc() { r=$?; if [ "$r" -ne 0 ]; then echo "--- step '$1' exit $r ---" >> "$LOG"; if [ "$FIRST_RC" -eq 0 ]; then FIRST_RC=$r; fi; fi; }
 # 1) FREE broad same-day feed: CRE trade-press closed deals (private + public)
 node scripts/cre-news-monitor.mjs >> "$LOG" 2>&1
+note_rc cre-news-monitor.mjs
 # 2) FREE early-signal: SEC EDGAR CRE acquisition 8-Ks (biggest public deals)
 node scripts/edgar-cre-monitor.mjs --days 14 >> "$LOG" 2>&1
+note_rc edgar-cre-monitor.mjs
 # 3) DTT sales import (free assessor source; frozen until a fresh feed is added)
 node scripts/ingest-la-sales.mjs >> "$LOG" 2>&1
+note_rc ingest-la-sales.mjs
 # 4) Rebuild flyers.agentabrams.com static site from the aggregated deals
 node scripts/build-flyers-site.mjs >> "$LOG" 2>&1
+note_rc build-flyers-site.mjs
 # 5) Email the morning's NEW closed deals to Steve via George (only if there are any)
 bash scripts/email-digest.sh >> "$LOG" 2>&1
+note_rc email-digest.sh
 # 6) Push the fresh viewer data to the LIVE Kamatera re-flyers-viewer (/search + /)
 bash scripts/sync-viewer-data-to-kamatera.sh >> "$LOG" 2>&1
+note_rc sync-viewer-data-to-kamatera.sh
 # 7) Refresh the deal-assets viewer's DB snapshot on Kamatera (re-flyers-deals / dealassets)
 bash scripts/sync-deals-to-kamatera.sh >> "$LOG" 2>&1
-echo "--- exit $? ---" >> "$LOG"
+note_rc sync-deals-to-kamatera.sh
+echo "--- exit $FIRST_RC ---" >> "$LOG"
+exit "$FIRST_RC"
diff --git a/scripts/property-flyers-cron.sh b/scripts/property-flyers-cron.sh
index 0f1fb1a..c25853d 100644
--- a/scripts/property-flyers-cron.sh
+++ b/scripts/property-flyers-cron.sh
@@ -7,5 +7,13 @@ cd "$HOME/Projects/re-flyer-aggregator" || exit 1
 LOG=data/property-flyers-cron.log
 echo "=== property-flyer refresh $(date) ===" >> "$LOG"
 node scripts/property-flyers.mjs --n 150 --pages 6 --delay 700 >> "$LOG" 2>&1
-rsync -az -e ssh public/flyers-found/ root@45.61.58.125:/var/www/flyers.crcp.agentabrams.com/flyers-found/ >> "$LOG" 2>&1 \
-  && echo "deployed $(node -e "console.log(require('./public/flyers-found/property-flyers.json').length)") flyers $(date)" >> "$LOG"
+# TK-11856 rc-propagation (exit-code ONLY, no behavior change): the rsync still runs after a failed
+# crawl exactly as before; we capture the crawl rc (previously swallowed) + the rsync rc and exit with
+# the first nonzero instead of whatever the trailing && list returned. Undo: git revert.
+CRAWL_RC=$?
+rsync -az -e ssh public/flyers-found/ root@45.61.58.125:/var/www/flyers.crcp.agentabrams.com/flyers-found/ >> "$LOG" 2>&1
+RSYNC_RC=$?
+[ "$RSYNC_RC" -eq 0 ] && echo "deployed $(node -e "console.log(require('./public/flyers-found/property-flyers.json').length)") flyers $(date)" >> "$LOG"
+echo "=== exit crawl=$CRAWL_RC rsync=$RSYNC_RC ===" >> "$LOG"
+if [ "$CRAWL_RC" -ne 0 ]; then exit "$CRAWL_RC"; fi
+exit "$RSYNC_RC"

← 085c34d auto-data-snapshot: 2026-09-26T06:47:29 (1 data files) — pub  ·  back to Re Flyer Aggregator  ·  auto-data-snapshot: 2026-09-26T12:44:57 (6 data files) — dat f31dd1c →