From 736f6de9365a88d52dfea6fac6f62b75041562e5 Mon Sep 17 00:00:00 2001 From: Nicolas Dandrimont Date: Tue, 13 Sep 2016 16:14:45 +0200 Subject: [PATCH] lister: properly select credentials for each request --- swh/lister/github/lister.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swh/lister/github/lister.py b/swh/lister/github/lister.py index ecc5e8f..a4086a3 100644 --- a/swh/lister/github/lister.py +++ b/swh/lister/github/lister.py @@ -137,11 +137,11 @@ def fetch(conf, mk_session, min_id=None, max_id=None): max_id = float('inf') next_id = min_id - cred = random.choice(conf['credentials']) - while min_id <= next_id <= max_id: logging.info('listing repos starting at %d' % next_id) since = next_id - 1 # github API ?since=... is '>' strict, not '>=' + + cred = random.choice(conf['credentials']) repos_res = gh_api_request('/repositories?since=%d' % since, **cred) if 'cache_dir' in conf and conf['cache_json']: