2015-01-12 2 views
0

: worker1에종료 셀러리 노동자 예를 들어

셀러리는 worker1에 0 배포 -n

@app.task() 
def f(num): 
    if num == 0: 
     # shutdown this worker 
     # celery will not distribute any tasks to this worker 
    else: 
     return num 

셀러리 -A 작업 노동자 --loglevel = 정보는 worker1에 살해됩니다. 다큐먼트에서 , The broadcast() function

>>> broadcast("shutdown") # shutdown all workers 
>>> broadcast("shutdown, destination="worker1.example.com") 

하지만 잘못, 나는 그것도 작동하지 않습니다

>>> broadcast("shutdown", destination=["worker1"]) 

로 변경.

그래서이 기능을 어떻게 달성할까요?

+0

음이 방송에서 같은과가 누락 된 셀러리 문서를 찾습니다 견적 – user2097159

+0

@ user2097159 그래,하지만 견적을 추가 할 때도 작동하지 않았다. – kthh7

답변

0

일반적으로 작업자 이름은 'celery @'로 시작합니다. 따라서 귀하의 경우 코드 아래 시도 : celery.control.broadcast ('종료'대상 = [ '셀러리 @의 worker1에'])