NO docker
This commit is contained in:
39
start_celery_worker.bat
Normal file
39
start_celery_worker.bat
Normal file
@@ -0,0 +1,39 @@
|
||||
@echo off
|
||||
REM ============================================
|
||||
REM PANJIT Document Translator V2
|
||||
REM Celery Worker 啟動腳本 (Windows)
|
||||
REM ============================================
|
||||
|
||||
echo ========================================
|
||||
echo PANJIT Document Translator V2
|
||||
echo Celery Worker 啟動
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM 設定環境變數
|
||||
set FLASK_ENV=production
|
||||
set LOG_LEVEL=INFO
|
||||
set CELERY_WORKER_CONCURRENCY=4
|
||||
set CELERY_WORKER_MAX_TASKS_PER_CHILD=1000
|
||||
|
||||
echo [INFO] 載入環境變數...
|
||||
echo.
|
||||
|
||||
REM 檢查 Python 虛擬環境
|
||||
if exist venv\Scripts\activate.bat (
|
||||
echo [INFO] 啟動虛擬環境...
|
||||
call venv\Scripts\activate.bat
|
||||
) else (
|
||||
echo [警告] 未找到虛擬環境 venv,使用系統 Python
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [INFO] 啟動 Celery Worker...
|
||||
echo [INFO] 並發數: %CELERY_WORKER_CONCURRENCY%
|
||||
echo [INFO] 按 Ctrl+C 停止服務
|
||||
echo.
|
||||
|
||||
REM Windows 下 Celery 需要使用 eventlet 或 gevent pool
|
||||
celery -A celery_app worker --loglevel=info --concurrency=%CELERY_WORKER_CONCURRENCY% --pool=solo --max-tasks-per-child=%CELERY_WORKER_MAX_TASKS_PER_CHILD%
|
||||
|
||||
pause
|
Reference in New Issue
Block a user