From b7bac682481f63125dd5afc4c447905363e728ca Mon Sep 17 00:00:00 2001 From: Silvie Chlupova Date: Aug 20 2019 13:57:12 +0000 Subject: 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))