user1814016
user1814016

Reputation: 2383

How can I periodically delete all the entries from a GAE datastore?

I use the Google App Engine datastore for temporary data storage. I need some way of automatically deleting every entry in a datastore model, every x hours.

How do I do this within Google App Engine? My app uses the Python runtime.

Upvotes: 1

Views: 685

Answers (1)

user7180
user7180

Reputation: 4096

Use Scheduled Tasks: https://developers.google.com/appengine/docs/python/config/cron

The App Engine Cron Service allows you to configure regularly scheduled tasks that operate at defined times or regular intervals. These tasks are commonly known as cron jobs. These cron jobs are automatically triggered by the App Engine Cron Service. For instance, you might use this to send out a report email on a daily basis, to update some cached data every 10 minutes, or to update some summary information once an hour.

A cron job will invoke a URL, using an HTTP GET request, at a given time of day. An HTTP request invoked by cron can run for up to 10 minutes, but is subject to the same limits as other HTTP requests.

Upvotes: 1

Related Questions