deploy: gate asset self-heal on staleness (skip cp/redis/clear-cache when...
Open-source Excel-native EPM and consolidation for SAP & Dynamics
Brought to you by:
konsolid-at
Originally created by: grynn-in
Fast-follow to [#125] (both reviewers flagged, non-blocking).
refresh-assets.sh now runs from the backend web entrypoint on every start — it unconditionally cps the baked assets.json, evicts the Redis assets_json key, and runs bench clear-cache (which boots a full Frappe/DB context). That cost is paid on every docker compose restart, crash-loop cycle, and scale event — even when the manifest is already correct.
Asks:
assets.json hash/mtime to the live sites/assets/assets.json and skip the heal when identical. This also fixes the dev hot-patch clobber (Opus L2): a docker cp konsol + bench build + restart writes newer konsol hashes into the volume manifest, which the current unconditional copy reverts on the next restart → freshly-built assets 404. A staleness/newer check would leave a genuinely-newer manifest alone.timeout 15 bench ... clear-cache — bound wall-clock so a hung clear-cache (DB lock) can't wedge gunicorn start (currently only guarded against non-zero exit, not hangs).mkdir -p sites/assets before the primary cp (RTL copy is guarded, primary isn't).Non-blocking; the current behavior is bounded + || true-wrapped + healthcheck-tolerant.
Originally posted by: grynn-in
📋 Decision brief (options + trade-offs + recommendation):
docs/developer-guide/decisions/konsolidat-131-selfheal-staleness.md— merged in [#133].Related
Tickets:
#133Ticket changed by: grynn-in