execution.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:nokia-deployer 作者: nokia 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号