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

Unified Diff: scripts/master/try_job_rietveld.py

Issue 334013004: Factored out calls to client.getPage to factor out common constants (timeout and buildbot name) and… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 6 years, 6 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 | no next file » | 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 983c2e5979670d8b26867ea7cf16b1fc2be1e19d..784a3b9862365d7d47518a960e00e4137ee0d924 100644
--- a/scripts/master/try_job_rietveld.py
+++ b/scripts/master/try_job_rietveld.py
@@ -233,6 +233,10 @@ class _RietveldPollerWithCache(base.PollingChangeSource):
self._pending_jobs_url = pending_jobs_url
self._processed_keys = None
+ def getPage(self, url): # pylint: disable=R0201
+ """Schedules a page at `url` to be downloaded. Returns a deferred."""
+ return client.getPage(url, agent='buildbot', timeout=2*60)
pgervais 2014/06/20 15:46:08 While we're at it, define this timeout in an insta
+
# base.PollingChangeSource overrides:
def poll(self):
"""Polls Rietveld for any pending try jobs and submit them.
@@ -253,8 +257,7 @@ class _RietveldPollerWithCache(base.PollingChangeSource):
log.msg('[RPWC] Poll started')
log.msg('[RPWC] Downloading %s...' % self._pending_jobs_url)
- pollDeferred = client.getPage(self._pending_jobs_url, agent='buildbot',
- timeout=2*60)
+ pollDeferred = self.getPage(self._pending_jobs_url)
pollDeferred.addCallback(self._ProcessResults)
pollDeferred.addErrback(log.err, '[RPWC] error')
return pollDeferred
@@ -322,7 +325,7 @@ class _RietveldPollerWithCache(base.PollingChangeSource):
next_url = self._pending_jobs_url + '&cursor=%s' % str(results['cursor'])
prev_cursor = results['cursor']
log.msg('[RPWC] Downloading %s...' % next_url)
- page_json = yield client.getPage(next_url, agent='buildbot', timeout=2*60)
+ page_json = yield self.getPage(next_url)
results = json.loads(page_json)
log.msg('[RPWC] Retrieved %d jobs' % len(all_jobs))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698