Skip to content

Commit 6385097

Browse files
committed
comment about multiple json events per chunk
1 parent 19e0255 commit 6385097

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

repo2docker/app.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,8 @@ def push_image(self):
457457
layers = {}
458458
last_emit_time = time.time()
459459
for chunk in client.push(self.output_image_spec, stream=True):
460+
# each chunk can be one or more lines of json events
461+
# split lines here in case multiple are delivered at once
460462
for line in chunk.splitlines():
461463
line = line.decode("utf-8", errors="replace")
462464
try:
@@ -478,11 +480,10 @@ def push_image(self):
478480
layers[progress["id"]] = progress
479481
if time.time() - last_emit_time > 1.5:
480482
self.log.info(
481-
"Pushing image\n", extra=dict(
482-
progress=progress_layers,
483-
layers=layers,
484-
phase="pushing",
485-
)
483+
"Pushing image\n",
484+
extra=dict(
485+
progress=progress_layers, layers=layers, phase="pushing"
486+
),
486487
)
487488
last_emit_time = time.time()
488489
self.log.info(

0 commit comments

Comments
 (0)