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)) |