Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: appengine/chromium_status/appengine_module/chromium_status/profiling.py

Issue 778533003: Moved chromium_status to appengine/ (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Profile reporting service.""" 5 """Profile reporting service."""
6 6
7 import datetime 7 import datetime
8 import json 8 import json
9 import logging 9 import logging
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 """A cron job.""" 110 """A cron job."""
111 @utils.requires_work_queue_login 111 @utils.requires_work_queue_login
112 def get(self): 112 def get(self):
113 """Delete reports older than ~6 months.""" 113 """Delete reports older than ~6 months."""
114 cutoff = datetime.datetime.now() - datetime.timedelta(days=31*6) 114 cutoff = datetime.datetime.now() - datetime.timedelta(days=31*6)
115 # Will only delete 1000 reports at a time max. Shouldn't be a problem unless 115 # Will only delete 1000 reports at a time max. Shouldn't be a problem unless
116 # we get more than 1000 reports/day. 116 # we get more than 1000 reports/day.
117 for report in db.Query(ProfileReport, keys_only=True).filter( 117 for report in db.Query(ProfileReport, keys_only=True).filter(
118 'date <', cutoff): 118 'date <', cutoff):
119 db.delete(report) 119 db.delete(report)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698