Skip to content

Commit

Permalink
fixed incomplete stream read
Browse files Browse the repository at this point in the history
  • Loading branch information
LanderOtto committed Dec 11, 2023
1 parent 37ae15c commit 7a112f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion streamflow/deployment/aiotarstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,13 @@ def __init__(self, stream):
self.position: int = 0

async def read(self, size: int | None = None):
buf = await self.stream.read(size)
buf = b""
while size > 0:
res = await self.stream.read(size)
if len(res) == 0:
break
size -= len(res)
buf += res
self.position += len(buf)
return buf

Expand Down

0 comments on commit 7a112f7

Please sign in to comment.