feat: 工作流记忆与内置工具、知你客服脚本、Agent管理技能展示与能力配置、文档与Windows启动脚本;忽略 redis_temp 二进制目录
Made-with: Cursor
This commit is contained in:
41
backend/scripts/restart_api_worker.ps1
Normal file
41
backend/scripts/restart_api_worker.ps1
Normal file
@@ -0,0 +1,41 @@
|
||||
$ErrorActionPreference = "SilentlyContinue"
|
||||
$backend = "D:\aaa\aiagent\backend"
|
||||
|
||||
Get-CimInstance Win32_Process | Where-Object {
|
||||
$_.CommandLine -and $_.CommandLine -match "celery" -and $_.CommandLine -match "celery_app"
|
||||
} | ForEach-Object {
|
||||
Write-Host "Stop Celery PID $($_.ProcessId)"
|
||||
Stop-Process -Id $_.ProcessId -Force
|
||||
}
|
||||
|
||||
Get-CimInstance Win32_Process | Where-Object {
|
||||
$_.CommandLine -and $_.CommandLine -match "uvicorn" -and $_.CommandLine -match "app.main:app"
|
||||
} | ForEach-Object {
|
||||
Write-Host "Stop Uvicorn PID $($_.ProcessId)"
|
||||
Stop-Process -Id $_.ProcessId -Force
|
||||
}
|
||||
|
||||
Start-Sleep -Seconds 2
|
||||
|
||||
$py = Join-Path $backend "venv\Scripts\python.exe"
|
||||
Write-Host "Start Uvicorn :8037 ..."
|
||||
Start-Process -FilePath $py -ArgumentList @(
|
||||
"-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8037", "--reload"
|
||||
) -WorkingDirectory $backend -WindowStyle Minimized
|
||||
|
||||
Start-Sleep -Seconds 2
|
||||
|
||||
Write-Host "Start Celery worker ..."
|
||||
Start-Process -FilePath $py -ArgumentList @(
|
||||
"-m", "celery", "-A", "app.core.celery_app", "worker",
|
||||
"--loglevel=info", "--pool=threads", "--concurrency=8"
|
||||
) -WorkingDirectory $backend -WindowStyle Minimized
|
||||
|
||||
Start-Sleep -Seconds 3
|
||||
try {
|
||||
$r = Invoke-WebRequest -Uri "http://127.0.0.1:8037/health" -UseBasicParsing -TimeoutSec 15
|
||||
Write-Host "health: $($r.Content)"
|
||||
} catch {
|
||||
Write-Host "health check failed: $($_.Exception.Message)"
|
||||
}
|
||||
Write-Host "Done."
|
||||
Reference in New Issue
Block a user