def concurrent_get_release_status(targets, timeout=4):
"""
Args:
target (list of tuples): a list of (host, target_path)
"""
if len(targets) == 0:
return []
# workaround for http://bugs.python.org/issue7980
import _strptime # noqa
pool = multiprocessing.dummy.Pool(min(20, len(targets)))
def _inner_get_release_status(target):
host, path = target
return get_release_status(host, path, timeout)
try:
return pool.map(_inner_get_release_status, targets, chunksize=1)
finally:
pool.close()
评论列表
文章目录