Question

Im using google appengine taskqueue to run one of my api in the background. this api takes about 3 seconds to run, but I add it to the queue several time like that:

while  len(lst) > 0:
        logging.info("calling my_api")
        taskqueue.add(url='/my_api', params={ 'param_a': lst.pop(0) },
                      retry_options= TaskRetryOptions(task_retry_limit=1) )

when len(lst) is 2 the taskqueue perform only one call to '/my_api'(I see in the log 2 entries of "calling my_api"). im using the most basic backend (B1). any ideas?

thanks.

Was it helpful?

Solution

Stop setting such a low task_retry_limit. Also, make sure that in your app.yaml you have threadsafe: true so your tasks can run concurrently without needing additional instances to be started.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top