Beispiel #1
0
 def list(self, report_id):
     cache_key = 'stats_' + report_id
     data = memcache.get(cache_key)
     if not data:
         try:
             data = StatsStore.all().filter('report_id =', report_id).fetch(1)[0].json
         except IndexError:
             # launch caching!
             logging.info("launching stats calc")
             deferred.defer(update_report_stats, report_id)
             abort(404)
         memcache.set(cache_key, data)
     return Response(data, mimetype='application/json')
def flush_all():
    memcache.flush_all()
    if request.args.get('stats', ''):
        for x in StatsStore.all():
            x.delete()
    return "all killed, colonel Trautman"
def flush_all():
    memcache.flush_all()
    if request.args.get('stats',''):
        for x in StatsStore.all():
            x.delete()
    return "all killed, colonel Trautman"