[Django]-Celery task method is not getting called

4👍

I have a few potential suggestions in the case that the other answer does not help.

First, do you have the celery worker running? If not, the task will be queued up, but not executed until the worker is ready to receive the task. You can simply call the function (without the .s) and the function should execute as a regular function.

Second, the “.s” is a signature, but is not actually called without “apply_async”. Try called the function like this:

push_sns_message.s(self.sns_connection, json.dumps(wrapper[0]), self.sns_arn).apply_async()

or like this:

push_sns_message.s(self.sns_connection, json.dumps(wrapper[0]), self.sns_arn).delay()

Hopefully this will help, but here’s the documentation that you would need to further investigate the issue.

0👍

The Log will show up in the worker log of celery not in the standard log of django

If you want to debug it have a look @ rdb for celery
http://docs.celeryproject.org/en/latest/reference/celery.contrib.rdb.html#usage

Leave a comment