def sync_from_file(file_path, skip_lines, chunk_size=250, is_initial_sync=False):
with open(file_path) as f:
# each line in file represents one block
# we can skip the blocks we already have
remaining = drop(skip_lines, f)
for batch in partition_all(chunk_size, remaining):
process_blocks(map(json.loads, batch), is_initial_sync)
评论列表
文章目录