From 9a2e4b5e50a3394ff5f72d1f0a38d62b5d332f56 Mon Sep 17 00:00:00 2001 From: Silvie Chlupova Date: Aug 21 2019 18:02:46 +0000 Subject: distgit: avoid making more than the predetermined number of workers Fixes: #807 --- diff --git a/dist-git/dist_git/importer.py b/dist-git/dist_git/importer.py index de94b54..0287d65 100644 --- a/dist-git/dist_git/importer.py +++ b/dist-git/dist_git/importer.py @@ -36,11 +36,11 @@ class Importer(object): # get the data r = get(self.get_url) # take the first task - builds = filter(lambda x: x["build_id"] not in exclude, r.json()) + builds = list(filter(lambda x: x["build_id"] not in exclude, r.json())) if not builds: log.debug("No new tasks to process.") - return [ImportTask.from_dict(build) for build in builds] + return [ImportTask.from_dict(build) for build in builds[:limit]] except Exception as e: log.exception("Failed acquire new packages for import:" + str(e))