I need to track data from another website. Since it's spread over 60+ pages, I intend to use a daily cron job to add a task to the queue. This task then should take care of one page and depending on some checks, put another instance of itself on the queue for the next page.
Now a simple
taskqueue.add(url='/path/to_self', params=control)
in the get of my webapp.RequestHandler class for this task leads to a
"POST /path/to_self HTTP/1.1" 405开发者_Python百科 -
Is there a way to get this to work, or is it simply not possible to add tasks to the queue from within tasks?
It's possible to add tasks from within tasks. I'm doing it in my application.
It's very useful when you want to migrate a large set of entities : one task processes a small chunk of entities then adds itself to the queue in order to process the rest until the migration is over.
I am not sure what is the problem with your code.
Have you implemented the post(self) method in your RequestHandler class ? Task calls default to the POST method.
精彩评论