Hi,
Just right now I installed the django-celery with rabbitMQ and I'm
running this simple tests.

I define this task on my contacts app:

# contacts/tasks.py:
from celery.decorators import task
@task()
def add(x, y):
   return x + y

Then, I execute it with python shell:
>>> from contacts.tasks import *
>>> r=add.delay(1,2)
>>> r.get()
...

But it never ends :(. I followed all the steps on
http://celeryproject.org/docs/django-celery/getting-started/first-steps-with-django.html
why it's not working? :(


1) This is the celery log:
[2011-06-20 13:44:41,682: INFO/MainProcess] Got task from broker:
contacts.tasks.add[dfb7a25d-a4e5-402e-a55e-7d9cf0940845]
[2011-06-20 13:44:41,714: DEBUG/MainProcess] Mediator: Running
callback for task:
contacts.tasks.add[dfb7a25d-a4e5-402e-a55e-7d9cf0940845]
[2011-06-20 13:44:41,715: DEBUG/MainProcess] TaskPool: Apply <function
execute_and_trace at 0x23b5c08> (args:('contacts.tasks.add',
'dfb7a25d-a4e5-402e-a55e-7d9cf0940845', (1, 2), {})
kwargs:{'hostname': 'e4200', 'request': {'retries': 0, 'loglevel': 10,
'delivery_info': {'consumer_tag': u'2', 'routing_key': u'celery',
'exchange': u'celery'}, 'is_eager': False, 'logfile': None, 'id':
'dfb7a25d-a4e5-402e-a55e-7d9cf0940845'}})
[2011-06-20 13:44:41,722: DEBUG/MainProcess] Task accepted:
contacts.tasks.add[dfb7a25d-a4e5-402e-a55e-7d9cf0940845] pid:9711
[2011-06-20 13:44:41,737: DEBUG/PoolWorker-3] (0.001) SELECT
`celery_taskmeta`.`id`, `celery_taskmeta`.`task_id`,
`celery_taskmeta`.`status`, `celery_taskmeta`.`result`,
`celery_taskmeta`.`date_done`, `celery_taskmeta`.`traceback` FROM
`celery_taskmeta` WHERE `celery_taskmeta`.`task_id` =
'dfb7a25d-a4e5-402e-a55e-7d9cf0940845' ;
args=('dfb7a25d-a4e5-402e-a55e-7d9cf0940845',)
[2011-06-20 13:44:41,741: DEBUG/PoolWorker-3] (0.001) INSERT INTO
`celery_taskmeta` (`task_id`, `status`, `result`, `date_done`,
`traceback`) VALUES ('dfb7a25d-a4e5-402e-a55e-7d9cf0940845',
'SUCCESS', 'gAJLAy4=', '2011-06-20 13:44:41', NULL);
args=('dfb7a25d-a4e5-402e-a55e-7d9cf0940845', 'SUCCESS', u'gAJLAy4=',
u'2011-06-20 13:44:41', None)
[2011-06-20 13:44:41,755: INFO/MainProcess] Task
contacts.tasks.add[dfb7a25d-a4e5-402e-a55e-7d9cf0940845] succeeded in
0.0385010242462s: 3

2) This is the RabbitMQ log:
=INFO REPORT==== 20-Jun-2011::13:56:34 ===
accepted TCP connection on [::]:5672 from 127.0.0.1:47866
=INFO REPORT==== 20-Jun-2011::13:56:34 ===
starting TCP connection <0.5553.0> from 127.0.0.1:47866
=INFO REPORT==== 20-Jun-2011::13:56:34 ===
closing TCP connection <0.5553.0> from 127.0.0.1:47866

3) I put this at the end of my project/settings.py
## Django celery stuff
import djcelery
djcelery.setup_loader()
# Broker
BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "/"
## end

4) I've got this entry on celery_taskmeta
| 26 | 9e3fd83d-3073-439a-b851-07748a4c70f3 | SUCCESS | gAJLAy4= |
2011-06-20 13:56:34 | NULL      |

5) I don't know if it's normal but the db table djcelery_taskstate is empty.

What is wrong?

Thanks !!
-- 
Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to