Greetings fellow GAE dorks,

So I'm trying to clean up an existing app.  I want to delete all the
entities of a certain class.  Since there's no automagic way to do
this, I made a handler that deletes them a block at a time.  Here it
is:

class DeleteHandler(BaseRequestHandler):
  def get(self):
    size = int(self.request.get('size',default_value='10'))
    touches = Touch.gql('ORDER BY time desc').fetch(size)
    db.delete(touches)
    self.response.out.write("ok")


Pretty simple.  So I called this in a loop for a while, and it started
timing out at the query.  Hm.  Perhaps a problem with the index?

I then changed the query to this:
    touches = Touch.all().fetch(size)

So that the first index wasn't involved.  This worked for a while, but
then started timing out again.  Here's the error:

Traceback (most recent call last):
  File "/base/python_lib/versions/1/google/appengine/ext/webapp/
__init__.py", line 499, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/showmeflow/1.329447312090117530/main.py",
line 58, in get
    most_recent_touches = Touch.all().fetch(size)
  File "/base/python_lib/versions/1/google/appengine/ext/db/
__init__.py", line 1377, in fetch
    raw = self._get_query().Get(limit, offset)
  File "/base/python_lib/versions/1/google/appengine/api/
datastore.py", line 938, in Get
    return self._Run(limit, offset)._Next(limit)
  File "/base/python_lib/versions/1/google/appengine/api/
datastore.py", line 882, in _Run
    _ToDatastoreError(err)
  File "/base/python_lib/versions/1/google/appengine/api/
datastore.py", line 1636, in _ToDatastoreError
    raise errors[err.application_error](err.error_detail)
Timeout



What's a dork to do?

Ben
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to