Skip to content

Instantly share code, notes, and snippets.

@cassioeskelsen
Created March 14, 2022 03:08
Show Gist options
  • Save cassioeskelsen/81a73edf8f51f0dd239e601a88ad68dd to your computer and use it in GitHub Desktop.
Save cassioeskelsen/81a73edf8f51f0dd239e601a88ad68dd to your computer and use it in GitHub Desktop.
async def main() -> dict:
async with redis.client() as conn:
while True:
chunk = []
for _ in range(0, 100):
item = await conn.lpop("votos_bd")
if item is not None:
chunk = chunk + json.loads(item)
else:
break
if not chunk:
return
else:
block_id = str(uuid.uuid4())
container_client.upload_blob(name=block_id, data=json.dumps(chunk))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment