HY!
I have a list in GAE, around 300 entries and I would like to send an email to everyone. I've already prepared a script that get all enterprises and then makes a loop for each one and in each iteration it sends an email. Now im concerned with timeout. If I do all the thing in one step, it might take too much time and then i dont know to who i sent or not.
My script is like this:
from models.开发者_JAVA技巧Enterprise import Enterprise
from google.appengine.api import mail
esq = Enterprise.all()
es = esq.fetch(1000) # normally around 300
for e in es:
mail.send_mail(sender="myemail", to=str(e.email), subject="...")
I suggest you to delegate this task to a taskqueue that provides a fairly high timeout set to 10 minutes.
精彩评论