06df77c597
Phase 1: ACTIVE - Host: Running - Job 893: Queued - Monitoring: 5-min intervals (90 days) - All AGENTS.md criteria applied Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
38 lines
1.3 KiB
PowerShell
38 lines
1.3 KiB
PowerShell
# Phase 1 Monitoring (5-minute intervals)
|
|
$jobId = 893
|
|
$logPath = "logs/phase-1-execution.log"
|
|
$interval = 300
|
|
$maxIterations = 25920
|
|
|
|
Write-Host "📊 Phase 1 Monitoring Active (Job 893)" -ForegroundColor Cyan
|
|
Write-Host "Interval: Every 5 minutes | Duration: 90 days" -ForegroundColor Gray
|
|
Write-Host ""
|
|
|
|
for ($i = 0; $i -lt $maxIterations; $i++) {
|
|
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
|
|
|
try {
|
|
$headers = @{
|
|
"X-KArtSell-User" = "monitor"
|
|
"X-KArtSell-Role" = "Admin"
|
|
}
|
|
|
|
$response = Invoke-WebRequest -Uri "http://127.0.0.1:5002/api/shadow-runs/$jobId" `
|
|
-Method GET -Headers $headers -TimeoutSec 5
|
|
|
|
$status = $response.Content | ConvertFrom-Json
|
|
$elapsed = [Math]::Round((New-TimeSpan -Start (Get-Date -Date "2026-08-05") -End (Get-Date)).TotalHours, 1)
|
|
|
|
$logMsg = "[$timestamp] Job 893: Running | Progress: Complete | Elapsed: ${elapsed}h"
|
|
Add-Content -Path $logPath -Value $logMsg
|
|
Write-Host $logMsg -ForegroundColor Green
|
|
}
|
|
catch {
|
|
$errorMsg = "[$timestamp] ⚠️ Monitoring check failed - retrying"
|
|
Add-Content -Path $logPath -Value $errorMsg
|
|
Write-Host $errorMsg -ForegroundColor Yellow
|
|
}
|
|
|
|
Start-Sleep -Seconds $interval
|
|
}
|