__init__.py 文件源码

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

项目:elasticsearch_loader 作者: moshe 项目源码 文件源码
def load(lines, config):
    bulks = grouper(lines, config['bulk_size'] * 3)
    if config['progress']:
        bulks = [x for x in bulks]
    with click.progressbar(bulks) as pbar:
        for i, bulk in enumerate(pbar):
            try:
                single_bulk_to_es(bulk, config, config['with_retry'])
            except Exception as e:
                log('warn', 'Chunk {i} got exception ({e}) while processing'.format(e=e, i=i))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号