1) To add a task to a named queue, I use this:
from google.appengine.api.labs import taskqueue
taskqueue.Task(url='<url>',
method='GET',
params={'id': id}).add(queue_name='<name from
yaml>')
On Sep 6, 10:27 am, djidjadji <[email protected]> wrote:
> The reason for this is that the examples in the doc are for the webapp
> framework.
> For a webapp requesthandler the default status code is 200.
> So just exiting the handler with "return" gives a status of 200.
>
> Your code sample suggests you use Django and that has a non 200 status
> code as default.
> You need to supply it a HttpResponse object with the right status
> code, its default status code is 200.
>
> 2009/9/5 GAEfan <[email protected]>:
>
>
>
> > Answering 2) and 3) myself...
>
> > Make sure your handler returns an http status response of 200. Else,
> > the task keeps getting executed over and over again, never clearing
> > out of the queue. Unfortunately, some of the examples given just have
> > the handler end in:
>
> > return
>
> > Make sure it ends in something like:
>
> > return HttpResponse("Task Executed", mimetype='text/plain')
>
> > so that it gives a 200 status, and clears out of the queue. Else, the
> > task repeats endlessly (like in my case, where it sent a test email
> > dozens of times, waiting for the 200 confirmation)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---