← back to Nationalrealestate
Add refresh-commercial.sh — daily refresh of CA DRE registry + LA commercial data
2bfd4ff88aaae0be93fbdd2322d508511bc72dd3 · 2026-07-22 10:28:10 -0700 · Steve
Files touched
A scripts/refresh-commercial.sh
Diff
commit 2bfd4ff88aaae0be93fbdd2322d508511bc72dd3
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Jul 22 10:28:10 2026 -0700
Add refresh-commercial.sh — daily refresh of CA DRE registry + LA commercial data
---
scripts/refresh-commercial.sh | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/scripts/refresh-commercial.sh b/scripts/refresh-commercial.sh
new file mode 100755
index 0000000..cdcc75b
--- /dev/null
+++ b/scripts/refresh-commercial.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# Daily refresh for the LA commercial-RE-news data. Safe on prod (Kamatera) OR local.
+# - CA DRE broker/firm registry: the source (secure.dre.ca.gov) refreshes DAILY,
+# so re-pull keeps LA firm/broker intel current. Self-contained (fetches the file).
+# - LA commercial parcels: re-materialize from the assessor sqlite (changes rarely,
+# but cheap + idempotent — the ETL DELETEs+reloads county 06037).
+# - Briefs: local-LLM only, so run ONLY where an Ollama is reachable (skipped on prod).
+#
+# Install as a daily cron (gated — see the pending-approval memo). Logs to /tmp.
+set -uo pipefail
+cd "$(dirname "$0")/.." || exit 1
+LOG=/tmp/refresh-commercial.log
+echo "=== $(date) refresh-commercial start ===" >> "$LOG"
+
+NODE_OPTIONS=--max-old-space-size=6144 npm run ingest:brokers -- ca >> "$LOG" 2>&1 \
+ && echo "[ok] ca_dre registry refreshed" >> "$LOG" \
+ || echo "[FAIL] ca_dre registry" >> "$LOG"
+
+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"
+
+if curl -s --max-time 3 "${OLLAMA_URL:-http://127.0.0.1:11434}/api/tags" >/dev/null 2>&1; then
+ npm run ingest:commercial-briefs >> "$LOG" 2>&1 \
+ && echo "[ok] briefs regenerated (Ollama present)" >> "$LOG" \
+ || echo "[FAIL] briefs" >> "$LOG"
+else
+ echo "[skip] briefs — no Ollama reachable on this host" >> "$LOG"
+fi
+echo "=== $(date) refresh-commercial done ===" >> "$LOG"
← 948bf60 Deepen LA: commercial property-detail page unifying facts +
·
back to Nationalrealestate
·
Fix refresh-commercial Ollama check: curl -sf + grep models f5468f1 →