I'm trying to add a task to non-default queue "slowQueue" using:
taskqueue.Queue('slowQueue').add(url='/worker/slow', params={'name': name})
I receive the error "TypeError: add() got an unexpected keyword argument 'url'"
How do you add a task to a non-default queue in google app engine?
You suppose to add task(s) when calling Queue.add()
q = taskqueue.Queue('slowQueue')
task = taskqueue.Task(url='/worker/slow', params={'name': name})
q.add(task)
Alternatively (to Shay's answer), if you prefer a shorter but less object oriented style:
taskqueue.add(queue_name='slowQueue', url='/worker/slow', params={'name': name})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With