← back to Nationalrealestate
refresh-commercial: gate briefs on actual model name (prod has empty ollama, must skip)
701cb102e6e81c8793c58bd1d211de7fd3fc2633 · 2026-07-22 10:34:32 -0700 · Steve
Files touched
M scripts/refresh-commercial.sh
Diff
commit 701cb102e6e81c8793c58bd1d211de7fd3fc2633
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Jul 22 10:34:32 2026 -0700
refresh-commercial: gate briefs on actual model name (prod has empty ollama, must skip)
---
scripts/refresh-commercial.sh | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/refresh-commercial.sh b/scripts/refresh-commercial.sh
index 876096b..025d107 100755
--- a/scripts/refresh-commercial.sh
+++ b/scripts/refresh-commercial.sh
@@ -20,9 +20,11 @@ npm run ingest:commercial -- la >> "$LOG" 2>&1 \
&& echo "[ok] la commercial parcels refreshed" >> "$LOG" \
|| echo "[skip/FAIL] la commercial (sqlite may be absent on this host)" >> "$LOG"
-# -f fails on non-2xx (prod's :11434 answers 404 — must NOT count as Ollama), and the
-# body must actually be an Ollama tags response, else skip briefs cleanly.
-if curl -sf --max-time 3 "${OLLAMA_URL:-http://127.0.0.1:11434}/api/tags" 2>/dev/null | grep -q '"models"'; then
+# Run briefs ONLY where the actual model is pulled. Prod's :11434 answers /api/tags with
+# an empty {"models":[]} (Ollama installed, no models), so we must grep the model NAME —
+# not just the "models" key — else /api/generate 404s. Empty/absent -> skip cleanly.
+BRIEF_MODEL="${OLLAMA_MODEL:-qwen2.5}"
+if curl -sf --max-time 3 "${OLLAMA_URL:-http://127.0.0.1:11434}/api/tags" 2>/dev/null | grep -q "$BRIEF_MODEL"; then
npm run ingest:commercial-briefs >> "$LOG" 2>&1 \
&& echo "[ok] briefs regenerated (Ollama present)" >> "$LOG" \
|| echo "[FAIL] briefs" >> "$LOG"
← f5468f1 Fix refresh-commercial Ollama check: curl -sf + grep models
·
back to Nationalrealestate
·
refresh-commercial: gate briefs on explicit REFRESH_BRIEFS=1 17cdf50 →