How to create Celery Windows Service?

前端 未结 5 1867
鱼传尺愫
鱼传尺愫 2020-12-24 04:56

I\'m trying to create a Windows Service to launch Celery. I have come across an article that does it using Task Scheduler. However it seems to launch numerous celery instanc

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 05:54

    @azalea 's answer helped me a lot, but one thing I like to highlight here is, the service (celery_service.py) needs to be installed with your user/password, otherwise, when you run subprocess.Popen(args) in SvcDoRun() function, nothing will happen as there will be a permission issue. To set the user/password, you can choose one of two methods:

    1. Using command line:

      python33 .\celeryService1.py --username .\USERNAME --password PASSWORD
      
    2. Go to Computer Management(local) > Services and Applications > Services, find your server (in @azalea's example, it is "Celery Distributed Task Queue Service"), and right click to open Properties page, input "This account" in Log On tab

提交回复
热议问题