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))
评论列表
文章目录