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
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)
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()