added fix for deployment race condition
This commit is contained in:
+13
-3
@@ -7,7 +7,7 @@
|
||||
>
|
||||
> Ask Claude Code: "Please update CONTEXT.md with what we did today"
|
||||
|
||||
Last updated: 2026-02-14 (session 3)
|
||||
Last updated: 2026-02-14 (session 4)
|
||||
|
||||
---
|
||||
|
||||
@@ -28,7 +28,17 @@ Last updated: 2026-02-14 (session 3)
|
||||
- **Running on:** demo-felhom (N100 mini PC) at 192.168.0.162:8080
|
||||
- **All Phase 1 features working:** deploy, start/stop/restart/update, logs, health-aware states, auth
|
||||
|
||||
### What was just completed (2026-02-14 session 3)
|
||||
### What was just completed (2026-02-14 session 4)
|
||||
- **Fixed deploy race condition** in `internal/stacks/deploy.go`:
|
||||
- In-memory `Deployed` flag now set BEFORE `docker compose up -d` (compose up can take 30-60s for image pulls)
|
||||
- On failure: both in-memory state and disk (app.yaml) are reverted
|
||||
- Eliminates stale "Telepítés" button during long compose operations
|
||||
- **Added `checkBeforeDeploy()` JS guard** in `internal/web/templates.go`:
|
||||
- Telepítés buttons on Vezérlőpult and Alkalmazások pages now fetch live state from `/api/stacks/{name}` before navigating
|
||||
- If app is already deployed (e.g., another tab deployed it), shows alert and reloads page instead of navigating to deploy form
|
||||
- Catches stale UI state gracefully
|
||||
|
||||
### Previously completed (2026-02-14 session 3)
|
||||
- **Enhanced debug logging** across all stack operations in `internal/stacks/`:
|
||||
- **Operation timing**: All stack ops (start, stop, restart, update, deploy) now log elapsed time
|
||||
- **Post-start container state check**: Async goroutine after start/restart/update/deploy
|
||||
@@ -179,7 +189,7 @@ Last updated: 2026-02-14 (session 3)
|
||||
- Go maps have random iteration order — always sort slices before displaying
|
||||
- Docker `.State`="running" doesn't mean healthy — check `.Status` for "(health: starting)" / "(unhealthy)"
|
||||
- Paperless-ngx needs `PAPERLESS_OCR_LANGUAGES` (plural) to install language packs, `PAPERLESS_OCR_LANGUAGE` (singular) to select
|
||||
- After deploying a stack, update the in-memory Deployed flag immediately — RefreshStatus() only reads docker ps
|
||||
- In-memory Deployed flag must be set BEFORE `docker compose up -d` (not after) — compose can take 30-60s for image pulls, during which the UI would show a stale "Telepítés" button
|
||||
- Cloudflare Tunnel handles *.demo-felhom.eu → Traefik handles Host()-based routing to containers
|
||||
- BIOS "AC Power Recovery" must be enabled on N100 for auto-restart after power outage
|
||||
- `docker compose up -d` returns exit 0 even when containers immediately crash-loop — need post-start status check to detect this
|
||||
|
||||
Reference in New Issue
Block a user