diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2015-06-23 17:55:29 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-12 22:53:22 +0100 |
commit | e6f66370c6ce15aca18ef64491bab3dc92b80c57 (patch) | |
tree | 35ce4b894177f6032bb1556559d1c368107a0961 /meta/classes | |
parent | 4d4d9e8aa68a185b330ffbdb2e084b31fa6a6451 (diff) | |
download | openembedded-core-contrib-e6f66370c6ce15aca18ef64491bab3dc92b80c57.tar.gz |
classes/sstate.bbclass: Improve checkstatus using connection cache.
Use FetcherConnectionCache to improve times when do checkstatus over
sstate resources.
[YOCTO #7796]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/sstate.bbclass | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 1e2d4f6fc0d..5b64b493e93 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -739,6 +739,13 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False): if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1": localdata.delVar('BB_NO_NETWORK') + from bb.fetch2 import FetchConnectionCache + def checkstatus_init(thread_worker): + thread_worker.connection_cache = FetchConnectionCache() + + def checkstatus_end(thread_worker): + thread_worker.connection_cache.close_connections() + def checkstatus(thread_worker, arg): (task, sstatefile) = arg @@ -748,7 +755,8 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False): bb.debug(2, "SState: Attempting to fetch %s" % srcuri) try: - fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2) + fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2, + connection_cache=thread_worker.connection_cache) fetcher.checkstatus() bb.debug(2, "SState: Successful fetch test for %s" % srcuri) ret.append(task) @@ -771,7 +779,9 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False): bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist)) import multiprocessing nproc = min(multiprocessing.cpu_count(), len(tasklist)) - pool = oe.utils.ThreadedPool(nproc, len(tasklist)) + + pool = oe.utils.ThreadedPool(nproc, len(tasklist), + worker_init=checkstatus_init, worker_end=checkstatus_end) for t in tasklist: pool.add_task(checkstatus, t) pool.start() |