58 lines
1.6 KiB
Batchfile
58 lines
1.6 KiB
Batchfile
@echo off
|
|
chcp 65001 >nul
|
|
echo =======================================
|
|
echo Starting LightRAG Production System
|
|
echo =======================================
|
|
|
|
REM Kill any existing process using port 3015
|
|
echo Checking for existing server on port 3015...
|
|
for /f "tokens=5" %%a in ('netstat -ano ^| findstr :3015') do (
|
|
set pid=%%a
|
|
)
|
|
if defined pid (
|
|
echo Found existing process with PID %pid%. Killing...
|
|
taskkill /F /PID %pid% >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo Failed to kill process %pid%. It may have already exited.
|
|
) else (
|
|
echo Process %pid% killed.
|
|
)
|
|
) else (
|
|
echo No existing server found on port 3015.
|
|
)
|
|
|
|
REM Recompile web UI if source exists
|
|
echo Checking web UI source...
|
|
if exist "LightRAG-main\lightrag_webui\package.json" (
|
|
echo Found web UI source. Building...
|
|
REM Ensure Node version 22.17.1
|
|
where nvm >nul 2>&1
|
|
if not errorlevel 1 (
|
|
echo Using nvm to switch to Node 22.17.1...
|
|
call nvm use 22.17.1
|
|
) else (
|
|
echo nvm not found, using system Node.
|
|
)
|
|
cd LightRAG-main\lightrag_webui
|
|
REM Check if bun is available
|
|
where bun >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo bun not found, using npm...
|
|
call npm run build-no-bun
|
|
) else (
|
|
echo Using bun...
|
|
call bun run build
|
|
)
|
|
cd ..\..
|
|
echo Web UI build completed.
|
|
) else (
|
|
echo Web UI source not found, using pre-built assets.
|
|
)
|
|
|
|
REM Start the LightRAG server using the fixed Python script
|
|
echo Starting LightRAG server...
|
|
python start_server_fixed.py
|
|
if errorlevel 1 (
|
|
echo Server failed to start. Press any key to close...
|
|
pause
|
|
) |