soyailabs / start_server.ps1
SOY NV AI
feat: Add webnovel continue upload feature and improve RAG
9fa456d
raw
history blame
970 Bytes
# μ„œλ²„ μžλ™ μž¬μ‹œμž‘ 슀크립트
$ErrorActionPreference = "Continue"
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $scriptPath
function Start-Server {
Write-Host "[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] μ„œλ²„ μ‹œμž‘ 쀑..." -ForegroundColor Green
$process = Start-Process -FilePath "python" -ArgumentList "run.py" -PassThru -NoNewWindow -Wait
if ($process.ExitCode -ne 0) {
Write-Host "[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] μ„œλ²„κ°€ μ’…λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€. 5초 ν›„ μž¬μ‹œμž‘ν•©λ‹ˆλ‹€..." -ForegroundColor Yellow
Start-Sleep -Seconds 5
Start-Server
}
}
# λ¬΄ν•œ λ£¨ν”„λ‘œ μ„œλ²„ μ‹€ν–‰
while ($true) {
try {
Start-Server
}
catch {
Write-Host "[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] 였λ₯˜ λ°œμƒ: $_" -ForegroundColor Red
Write-Host "5초 ν›„ μž¬μ‹œμž‘ν•©λ‹ˆλ‹€..." -ForegroundColor Yellow
Start-Sleep -Seconds 5
}
}