diff options
Diffstat (limited to 'meta')
| -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 1e2d4f6fc0..5b64b493e9 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): | |||
| 739 | if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1": | 739 | if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1": |
| 740 | localdata.delVar('BB_NO_NETWORK') | 740 | localdata.delVar('BB_NO_NETWORK') |
| 741 | 741 | ||
| 742 | from bb.fetch2 import FetchConnectionCache | ||
| 743 | def checkstatus_init(thread_worker): | ||
| 744 | thread_worker.connection_cache = FetchConnectionCache() | ||
| 745 | |||
| 746 | def checkstatus_end(thread_worker): | ||
| 747 | thread_worker.connection_cache.close_connections() | ||
| 748 | |||
| 742 | def checkstatus(thread_worker, arg): | 749 | def checkstatus(thread_worker, arg): |
| 743 | (task, sstatefile) = arg | 750 | (task, sstatefile) = arg |
| 744 | 751 | ||
| @@ -748,7 +755,8 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False): | |||
| 748 | bb.debug(2, "SState: Attempting to fetch %s" % srcuri) | 755 | bb.debug(2, "SState: Attempting to fetch %s" % srcuri) |
| 749 | 756 | ||
| 750 | try: | 757 | try: |
| 751 | fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2) | 758 | fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2, |
| 759 | connection_cache=thread_worker.connection_cache) | ||
| 752 | fetcher.checkstatus() | 760 | fetcher.checkstatus() |
| 753 | bb.debug(2, "SState: Successful fetch test for %s" % srcuri) | 761 | bb.debug(2, "SState: Successful fetch test for %s" % srcuri) |
| 754 | ret.append(task) | 762 | ret.append(task) |
| @@ -771,7 +779,9 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False): | |||
| 771 | bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist)) | 779 | bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist)) |
| 772 | import multiprocessing | 780 | import multiprocessing |
| 773 | nproc = min(multiprocessing.cpu_count(), len(tasklist)) | 781 | nproc = min(multiprocessing.cpu_count(), len(tasklist)) |
| 774 | pool = oe.utils.ThreadedPool(nproc, len(tasklist)) | 782 | |
| 783 | pool = oe.utils.ThreadedPool(nproc, len(tasklist), | ||
| 784 | worker_init=checkstatus_init, worker_end=checkstatus_end) | ||
| 775 | for t in tasklist: | 785 | for t in tasklist: |
| 776 | pool.add_task(checkstatus, t) | 786 | pool.add_task(checkstatus, t) |
| 777 | pool.start() | 787 | pool.start() |
