Hi there
I have a function in my app that uses a lot of resources, and takes time to execute. This is normal and control, however I often get errors due to GAE limit of 30 secs/request.
My function takes the argument and returns several results one after the other, decreasing the size of the argument (a unicode string)
Summary:
def my_function(arg):
while arg!=u''
#do_stuff
#get result
#arg=new_argument(arg,result)
As the process costs resources, I thought I could split it and enqueue it:
def my_function(arg):
if arg==u''
#stop
else:
do_stuff
get_result
enqueue(my_function(new_argument))
However I'm worried to fall under the API queue limit of 100k calls as I might have a lot of iterations.
I was thinking of redirecting request one to another, which would executes them in a row, but then I have no way to control resource usage:
def my_function(arg):
if arg==u''
#stop
else:
do_stuff
get_result
return redirect('/my_function_url',args=(new_argument))
I don't know if there's a beter way to do it?