mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-20 06:34:55 +00:00
[improvement](config) add bat script for standalone start and llm start (#69)
This commit is contained in:
3
launchers/standalone/src/main/bin/env.bat
Normal file
3
launchers/standalone/src/main/bin/env.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
set "APP_NAME=chat-service"
|
||||
set "MAIN_CLASS=com.tencent.supersonic.StandaloneLauncher"
|
||||
30
launchers/standalone/src/main/bin/run.bat
Normal file
30
launchers/standalone/src/main/bin/run.bat
Normal file
@@ -0,0 +1,30 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set "binDir=%~dp0"
|
||||
set "baseDir=%~dp0.."
|
||||
set "libDir=%baseDir%\lib"
|
||||
set "confDir=%baseDir%\conf"
|
||||
set "webDir=%baseDir%\webapp"
|
||||
|
||||
call "%baseDir%\bin\env.bat"
|
||||
|
||||
set "CLASSPATH=%confDir%;%webDir%;%libDir%\*"
|
||||
|
||||
set "LANG=zh_CN.UTF-8"
|
||||
|
||||
cd /d "%baseDir%"
|
||||
|
||||
set "command=-Dfile.encoding=UTF-8 -Duser.language=Zh -Duser.region=CN -Duser.timezone=GMT+08 -Xms1024m -Xmx2048m -cp %CLASSPATH% %MAIN_CLASS%"
|
||||
|
||||
if not exist "%baseDir%\logs" (
|
||||
mkdir "%baseDir%\logs"
|
||||
)
|
||||
|
||||
if "%is_test%"=="true" (
|
||||
start "supersonic" /B java -Dspring.profiles.active=dev %command% >nul 2>"%baseDir%\logs\error.log"
|
||||
) else (
|
||||
start "supersonic" /B java %command% >nul 2>"%baseDir%\logs\error.log"
|
||||
)
|
||||
|
||||
endlocal
|
||||
42
launchers/standalone/src/main/bin/service.bat
Normal file
42
launchers/standalone/src/main/bin/service.bat
Normal file
@@ -0,0 +1,42 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set "binDir=%~dp0"
|
||||
set "baseDir=%~dp0.."
|
||||
set "confDir=%baseDir%\conf"
|
||||
call "%baseDir%\bin\env.bat"
|
||||
|
||||
set "command=%~1"
|
||||
|
||||
|
||||
if "%command%"=="start" (
|
||||
for /f "tokens=2" %%i in ('tasklist ^| findstr /i "java"') do (
|
||||
echo "Process (PID = %%i) is running."
|
||||
goto :EOF
|
||||
)
|
||||
echo "Starting %APP_NAME%"
|
||||
"%baseDir%\bin\run.bat" %MAIN_CLASS%
|
||||
echo "Process started, see logs/error with logs/error command"
|
||||
goto :EOF
|
||||
)
|
||||
|
||||
|
||||
if "%command%"=="stop" (
|
||||
for /f "tokens=2" %%i in ('tasklist ^| findstr /i "java"') do (
|
||||
taskkill /PID %%i /F
|
||||
echo "Process (PID = %%i) is killed."
|
||||
goto :EOF
|
||||
)
|
||||
echo "Process is not running."
|
||||
goto :EOF
|
||||
)
|
||||
|
||||
|
||||
if "%command%"=="restart" (
|
||||
for /f "tokens=2" %%i in ('tasklist ^| findstr /i "java"') do (
|
||||
taskkill /PID %%i /F
|
||||
echo "Process (PID = %%i) is killed."
|
||||
)
|
||||
"%baseDir%\bin\run.bat" %MAIN_CLASS%
|
||||
echo "%APP_NAME% started, see logs/error with logs/error command"
|
||||
)
|
||||
Reference in New Issue
Block a user