python - celery worker not working though rabbitmq has queue buildup -


i getting in touch celery , wrote task following tutorial somehow worker not getting , following log after entering command:

celery worker -a tasks -l debug 

i log:

running worker superuser privileges when worker accepts messages serialized pickle bad idea!  if want continue have set c_force_root environment variable (but please think before do).  user information: uid=0 euid=0 gid=0 egid=0 

and here task:

from celery import celery  app = celery('tasks', backend='amqp',broker='amqp://sanjay:**@localhost:5672//')  @app.task def gen_prime(x):     multiples = []     results = []     in xrange(2, x+1):         if not in multiples:             results.append(i)             j in xrange(i*i, x+1, i):                 multiples.append(j)     return results 

though in rabbitmq admin console see queue build when try generate prime numbers in ipython console not getting result on console.

here console action:

>>> tasks import gen_prime >>> pr=gen_prime.delay(10000) >>> pr.ready() false >>>  >>> pr.ready() false >>> pr.ready() false 

i trying solve 1 last 3 days not able solve it.

don't run celery workers root.

i recommend using supervisord manage celery workers - can use user configuration directive specify user run celery workers as.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -