I am able to execute my task no problem using
scrape_adhoc_reporting([store], [types], inventory)
This is a problem though, because this task can easily take an hour. So I try to make the task async. I tried both of following:
scrape_adhoc_reporting.apply_async(args=[[store], [types], inventory])
scrape_adhoc_reporting.delay([store], [types], inventory)
Both of these methods did not work. The view just redirects as it should, but the task never gets executed. There are no errors in the error log. Any insight as to what I am doing wrong?
Edit: After looking around a little bit more, I see people talking about registering a task. Is this something I need to do?
@task
or@periodic_task
) intasks.py
file in every app dir. If your task is defined elsewhere it will not be executed – Igor Apr 5 '13 at 14:19