ЛР 5 — БВТ2302 — Лебедев — на 5

This commit is contained in:
2026-11-22 23:05:53 +03:00
parent 276dbdad8a
commit fbd04ce238
112 changed files with 9536 additions and 16 deletions
+15
View File
@@ -0,0 +1,15 @@
# Defense scenario: stop ALL workers and leave them stopped (API, broker, storages untouched).
$ErrorActionPreference = 'Continue'
$root = Split-Path -Parent $PSScriptRoot
Set-Location $root
$envFile = if ($env:ENV_FILE) { $env:ENV_FILE } else { '.env' }
function Wait-Healthy([string]$svc) {
foreach ($cid in (& docker compose --env-file $envFile ps -q $svc)) {
for ($i = 0; $i -lt 120; $i++) {
if ((& docker inspect -f '{{.State.Health.Status}}' $cid) -eq 'healthy') { break }
Start-Sleep -Milliseconds 500
}
}
}
& docker compose --env-file $envFile stop worker 2>$null | Out-Null
& docker compose --env-file $envFile ps -a worker --format '{{.Name}} {{.State}}'