Files
Document_translator_V2_nodo…/start_celery_worker.bat
beabigegg 4cace93934 NO docker
2025-10-02 18:50:53 +08:00

40 lines
1.1 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@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