Files
aiagent/stop_aiagent.ps1
renjianbo df4fab1e6e feat: Agent 批量测试、作业助手与上传预览;Windows 启动脚本与文档- 新增 run_agent_test_cases 与示例 JSON、(红头)agent测试用例文档
- 扩展 test_agent_execution(--homework、UTF-8 控制台)
- 后端:uploads 预览、file_read、工作流与对话落盘等
- 前端:AgentChatPreview 与设计器相关调整
- 忽略 redis二进制、agent_workspaces、uploads、tessdata 等本机产物

Made-with: Cursor
2026-04-13 20:17:18 +08:00

50 lines
1.5 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
$ErrorActionPreference = "SilentlyContinue"
Write-Host "== AIAgent stop ==" -ForegroundColor Cyan
function Stop-ByCommandLine($pattern, $name) {
$targets = Get-CimInstance Win32_Process | Where-Object {
$_.CommandLine -and $_.CommandLine -match $pattern
}
if (-not $targets) {
Write-Host "[SKIP] ${name}: no matching process" -ForegroundColor DarkGray
return
}
foreach ($p in $targets) {
try {
Stop-Process -Id $p.ProcessId -Force
Write-Host "[OK] stopped ${name} PID=$($p.ProcessId)" -ForegroundColor Green
} catch {
Write-Host "[WARN] failed to stop ${name} PID=$($p.ProcessId)" -ForegroundColor Yellow
}
}
}
# 1) 停后端 APIuvicorn app.main:app
Stop-ByCommandLine "uvicorn\s+app\.main:app" "backend-api"
# 2) 停 Celery Worker
Stop-ByCommandLine "celery\s+-A\s+app\.core\.celery_app\s+worker" "celery-worker"
# 3) 停前端 devvite / pnpm dev / npm run dev
Stop-ByCommandLine "vite(\.js)?\s|pnpm\s+dev|npm\s+run\s+dev" "frontend-dev"
# 4) 停 Redis优先匹配本项目 redis-server
Stop-ByCommandLine "redis-server(\.exe)?(\s|$)" "redis"
Start-Sleep -Milliseconds 600
Write-Host ""
Write-Host "Port check:" -ForegroundColor Cyan
foreach ($port in 3001, 8037, 8041, 6379) {
$line = netstat -ano | Select-String ":$port\s+.*LISTENING" | Select-Object -First 1
if ($line) {
Write-Host " - ${port}: LISTEN" -ForegroundColor Yellow
} else {
Write-Host " - ${port}: free" -ForegroundColor Green
}
}
Write-Host ""
Write-Host "DONE: stop script finished" -ForegroundColor Green