Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 9c1b7d8

Browse files
committed
Also log read progress
1 parent 44170c8 commit 9c1b7d8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/jumpstarter/jumpstarter/common/storage.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,17 @@ async def read_from_storage_device(
114114
)
115115
with os.fdopen(os.open(path, os.O_RDONLY), "rb") as file:
116116
async with FileReadStream(file) as stream:
117+
total_bytes = 0
118+
next_print = 0
117119
async for chunk in stream:
118120
await resource.send(chunk)
121+
if logger:
122+
total_bytes += len(chunk)
123+
if total_bytes > next_print:
124+
logger.info(
125+
"read {} MB from storage device {}".format(
126+
total_bytes / (1024 * 1024),
127+
storage_device,
128+
)
129+
)
130+
next_print += 50 * 1024 * 1024

0 commit comments

Comments
 (0)