Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (23 sloc) 896 Bytes
#!/usr/bin/env python
import base64, cgi, logging, urllib, wsgiref.handlers
from datetime import *
from itertools import *
from downer import *
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.api import urlfetch
class DownerClear(webapp.RequestHandler):
def get(self):
hour_ago = + timedelta(minutes=-60)
cleared = 0
query = db.GqlQuery("SELECT __key__ FROM Downer WHERE down_at < :1", hour_ago)
results = query.fetch(500)
results_size = len(results)
cleared += results_size
return self.response.out.write("cleared %d" % cleared)
def main():
application = webapp.WSGIApplication([('/_downerclear', DownerClear)],
Jump to Line
Something went wrong with that request. Please try again.