File size: 1,018 Bytes
25f22bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@echo off
REM Script to start Celery components on Windows

REM Check if we're in the right directory
if not exist "app.py" (
    echo Please run this script from the backend directory
    pause
    exit /b 1
)

REM Function to start Celery worker
:start_worker
echo Starting Celery worker...
start "Celery Worker" cmd /k "celery -A celery_app worker --loglevel=info"
echo Celery worker started
goto :eof

REM Function to start Celery Beat scheduler
:start_beat
echo Starting Celery Beat scheduler...
start "Celery Beat" cmd /k "celery -A celery_beat_config beat --loglevel=info"
echo Celery Beat scheduler started
goto :eof

REM Main script logic
if "%1"=="worker" (
    call :start_worker
) else if "%1"=="beat" (
    call :start_beat
) else if "%1"=="all" (
    call :start_worker
    call :start_beat
) else (
    echo Usage: %0 {worker^|beat^|all}
    echo   worker - Start Celery worker
    echo   beat   - Start Celery Beat scheduler
    echo   all    - Start both worker and scheduler
    pause
    exit /b 1
)