- Updated `ready.py` to include a health check for the new `products_nav_history` endpoint, ensuring system readiness. - Enhanced the `ProductNavChartPanel` component to visualize historical NAV data with various charting options, including line and column charts. - Introduced new utility functions for filtering and aggregating NAV data, improving data handling in the frontend. - Updated tests to verify the inclusion of the new `products_nav_history` check in the API response. - Improved documentation to reflect recent changes and the new testing baseline of 833 passed tests, indicating enhanced stability. This update significantly improves the product API by providing access to historical NAV data and enhancing user insights through visualizations.
37 lines
1.4 KiB
PowerShell
37 lines
1.4 KiB
PowerShell
#Requires -Version 5.1
|
|
<#
|
|
.SYNOPSIS
|
|
停止占用 8000 的 JinRong uvicorn(及非 jinrong Docker 容器)。
|
|
#>
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
function Get-ListenerPids([int[]]$Ports) {
|
|
$pids = @()
|
|
foreach ($port in $Ports) {
|
|
Get-NetTCPConnection -LocalPort $port -State Listen -ErrorAction SilentlyContinue |
|
|
ForEach-Object { $pids += $_.OwningProcess }
|
|
}
|
|
$pids | Select-Object -Unique
|
|
}
|
|
|
|
Write-Host "Stopping uvicorn app.main on :8000 ..."
|
|
Get-CimInstance Win32_Process -Filter "Name='python.exe'" -ErrorAction SilentlyContinue |
|
|
Where-Object { $_.CommandLine -match 'uvicorn' -and $_.CommandLine -match 'app\.main:app' -and $_.CommandLine -match ':8000' } |
|
|
ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }
|
|
|
|
foreach ($procId in (Get-ListenerPids @(8000))) {
|
|
Stop-Process -Id $procId -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
if (Get-Command docker -ErrorAction SilentlyContinue) {
|
|
$name = docker ps --filter "publish=8000" --format "{{.Names}}" 2>$null | Select-Object -First 1
|
|
if ($name -and ($name.Trim() -notmatch '^jinrong')) {
|
|
Write-Host "Stopping Docker $name on 8000 ..."
|
|
docker stop $name.Trim() | Out-Null
|
|
}
|
|
}
|
|
|
|
Start-Sleep -Seconds 2
|
|
netstat -ano | findstr ":8000.*LISTENING"
|
|
Write-Host "Done. Start backend: .\scripts\dev\restart-dev.ps1 -Backend Local -SkipFrontend"
|