Poll gerrit only for projects that have it

Currently Stackalytics polls gerrit for all projects,
even for external non-OpenStack. With this patch communication
with gerrit is optimized and only hosted projects are queried.
The patch should decrease number of gerrit communication
errors.

Change-Id: I738cac6eb92615c5fe5d9e1bf1b878197d78876f
This commit is contained in:
Ilya Shakhat
2016-07-06 11:23:50 +03:00
parent f7b268fd4c
commit 6e8d1fab8a
3 changed files with 18 additions and 2 deletions

View File

@@ -131,6 +131,9 @@ def _process_repo(repo, runtime_storage_inst, record_processor_inst,
last_id = vcs_inst.get_last_id(branch)
runtime_storage_inst.set_by_key(vcs_key, last_id)
if 'has_gerrit' not in repo:
continue # do not poll reviews for those that do not have them
LOG.info('Processing reviews for repo: %s, branch: %s', uri, branch)
rcs_key = 'rcs:%s:%s' % (quoted_uri, branch)