rrs_upstream_history.py: drop threading

This is never going to work, the only way we can practically do parallel
execution is to run these things in a task which would basically amount
to distrodata's do_checkpkg; we may move to that in future but for now
just drop the threading code.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-03-01 16:33:58 +13:00
parent 687c2b0051
commit 0bab50462c

View File

@ -86,13 +86,11 @@ def set_regexes(d):
d.getVar(var, True)))
break
def get_upstream_info(thread_worker, arg):
def get_upstream_info(layerbranch, recipe_data, result):
from bb.utils import vercmp_string
from oe.recipeutils import get_recipe_upstream_version, \
get_recipe_pv_without_srcpv
(layerbranch, recipe_data, result) = arg
pn = recipe_data.getVar('PN', True)
recipe = Recipe.objects.get(layerbranch=layerbranch, pn=pn)
if not recipe:
@ -179,22 +177,9 @@ if __name__=="__main__":
history = RecipeUpstreamHistory(start_date = datetime.now())
from oe.utils import ThreadedPool
import multiprocessing
#nproc = min(multiprocessing.cpu_count(), len(recipes))
# XXX: The new tinfoil API don't support pythreads so
# set to 1 while tinfoil have support.
nproc = 1
pool = ThreadedPool(nproc, len(recipes))
result = []
for recipe_data in recipes:
pool.add_task(get_upstream_info, (layerbranch,
recipe_data, result))
pool.start()
pool.wait_completion()
get_upstream_info(layerbranch, recipe_data, result)
history.end_date = datetime.now()
history.save()