refactor: refactor of backend

This commit is contained in:
sophie committed 2026-09-28 14:52:28 +08:00
1 parent d4cb8c5def
commit 14e5af0c9c
55 files changed
+2251 -1805

No files matched your search

+17 -2
View File
@@ -452,6 +452,20 @@ function Start-ScheduleWorkerWindow {
-Command ".\.venv\Scripts\python.exe .\workers\worker_scheduler.py"
}
function Start-FixedAssetsWorkerWindow {
param(
[string]$BackendPath,
[string]$Mode,
[string]$DbUrl
)
Start-WorkerWindow `
-Title "fixed-assets-worker" `
-WorkingDirectory $BackendPath `
-EnvPrefix (Get-DatabaseUrlExport -Mode $Mode -DbUrl $DbUrl) `
-Command ".\.venv\Scripts\python.exe .\workers\worker_fixed_assets.py"
}
function Start-FreightRpaWorkerWindow {
param(
[string]$RepoRoot,
@@ -545,7 +559,8 @@ if (-not $SkipWorker.IsPresent) {
Start-ShippingWorkerWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $DatabaseUrl
Start-TransferWorkerWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $DatabaseUrl
Start-ScheduleWorkerWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $DatabaseUrl
$windowCount += 4
Start-FixedAssetsWorkerWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $DatabaseUrl
$windowCount += 5
if (-not $SkipRpaWorker.IsPresent) {
Start-FreightRpaWorkerWindow -RepoRoot $repoRoot -BackendPath $backendDir -EnvFiles $envFiles
$windowCount += 1
@@ -557,7 +572,7 @@ $windowCount += 1
Write-Host ""
Write-Host "Started in $windowCount new PowerShell windows." -ForegroundColor Green
if (-not $SkipWorker.IsPresent) {
Write-Host "Workers: kb-worker, shipping-worker, transfer-worker, schedule-worker$(if (-not $SkipRpaWorker.IsPresent) { ', freight-rpa-worker (mock)' })" -ForegroundColor Green
Write-Host "Workers: kb-worker, shipping-worker, transfer-worker, schedule-worker, fixed-assets-worker$(if (-not $SkipRpaWorker.IsPresent) { ', freight-rpa-worker (mock)' })" -ForegroundColor Green
}
Write-Host "Frontend URL: http://127.0.0.1:8881" -ForegroundColor Green
Write-Host "Backend URL: http://127.0.0.1:5052" -ForegroundColor Green