run.cmd 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. rem Name of nodes to start
  2. rem here we have a single node
  3. set CELERYD_NODES=w1
  4. rem or we could have three nodes:
  5. rem CELERYD_NODES="w1 w2 w3"
  6. rem App instance to use
  7. rem comment out this line if you don't use an app
  8. set CELERY_APP=proj
  9. rem or fully qualified:
  10. rem CELERY_APP="proj.tasks:app"
  11. set PATH_TO_PROJECT=D:\home\site\wwwroot
  12. rem Absolute or relative path to the 'celery' and 'Python' command:
  13. set CELERY_BIN=%PATH_TO_PROJECT%\env\Scripts\celery
  14. rem How to call manage.py
  15. set CELERYD_MULTI=multi
  16. rem - %n will be replaced with the first part of the nodename.
  17. rem - %I will be replaced with the current child process index
  18. rem and is important when using the prefork pool to avoid race conditions.
  19. set CELERYD_PID_FILE=%PATH_TO_PROJECT%\log\celerybeat.pid
  20. set CELERYD_LOG_FILE=%PATH_TO_PROJECT%\log\celerybeat.log
  21. set CELERYD_LOG_LEVEL=INFO
  22. rem CONFIG RELATED TO THE BEAT
  23. set CELERYD_DATABASE=django
  24. set CELERYD_SCHEDULER=django_celery_beat.schedulers:DatabaseScheduler
  25. rem You might need to change th path of the Python runing
  26. set PYTHONPATH=%PYTHONPATH%;%PATH_TO_PROJECT%;
  27. cd %PATH_TO_PROJECT%
  28. del %CELERYD_PID_FILE%
  29. del %CELERYD_LOG_FILE%
  30. %CELERY_BIN% -A %CELERY_APP% beat -S %CELERYD_DATABASE% --logfile=%CELERYD_LOG_FILE% --pidfile=%CELERYD_PID_FILE% --scheduler %CELERYD_SCHEDULER% --loglevel=%CELERYD_LOG_LEVEL%