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

Unified Diff: scripts/master/try_job_rietveld.py

Issue 305423002: Limited number of buildsets that can be used to initialize RietveldPollerWithCache's cache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Correct comment Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/master/unittests/try_job_rietveld_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/try_job_rietveld.py
diff --git a/scripts/master/try_job_rietveld.py b/scripts/master/try_job_rietveld.py
index 1682a0327c3ee91114942a08377362dac3106384..ecbec709d949aad4f25c9ae18c2e0395c45b1277 100644
--- a/scripts/master/try_job_rietveld.py
+++ b/scripts/master/try_job_rietveld.py
@@ -23,6 +23,10 @@ from master import master_utils
from master.try_job_base import TryJobBase
+# Number of recent buildsets used to initialize RietveldPollerWithCache's cache.
+MAX_RECENT_BUILDSETS_TO_INIT_CACHE = 10000
+
+
class _ValidUserPoller(internet.TimerService):
"""Check chromium-access for users allowed to send jobs from Rietveld.
"""
@@ -241,10 +245,11 @@ class _RietveldPollerWithCache(base.PollingChangeSource):
def _InitProcessedKeysCache(self):
log.msg('[RPWC] Initializing processed keys cache...')
- # Get all BuildBot build requests.
- brdicts = yield self.master.db.buildrequests.getBuildRequests()
+ # Get recent BuildBot buildsets.
Paweł Hajdan Jr. 2014/06/03 08:08:47 nit: Add a comment here that we need to limit the
Sergiy Byelozyorov 2014/06/03 08:20:01 Done.
+ bsdicts = yield self.master.db.buildsets.getRecentBuildsets(
+ MAX_RECENT_BUILDSETS_TO_INIT_CACHE)
- log.msg('[RPWC] Received %d build request dicts' % len(brdicts))
+ log.msg('[RPWC] Received %d buildset dicts' % len(bsdicts))
def asNaiveUTC(dt):
if dt is None:
@@ -256,10 +261,10 @@ class _RietveldPollerWithCache(base.PollingChangeSource):
# Compose a map of buildset ids to the submission timestamp.
buildsets = {}
- for brdict in brdicts:
- bsid = brdict.get('buildsetid')
+ for bsdict in bsdicts:
+ bsid = bsdict.get('bsid')
if bsid is not None:
- buildsets[bsid] = asNaiveUTC(brdict.get('submitted_at'))
+ buildsets[bsid] = asNaiveUTC(bsdict.get('submitted_at'))
log.msg('[RPWC] Processing %d buildsets' % len(buildsets))
« no previous file with comments | « no previous file | scripts/master/unittests/try_job_rietveld_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698