Created
March 14, 2022 03:08
-
-
Save cassioeskelsen/81a73edf8f51f0dd239e601a88ad68dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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