From d6ecaa2cbfccec94d172d02dde1a6fceca15a88d Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Tue, 14 Nov 2023 17:03:18 -0800 Subject: [PATCH] update progress responses --- server/download.go | 4 ++-- server/upload.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/download.go b/server/download.go index 13e8ee18..64ee5623 100644 --- a/server/download.go +++ b/server/download.go @@ -285,7 +285,7 @@ func (b *blobDownload) Wait(ctx context.Context, fn func(api.ProgressResponse)) } fn(api.ProgressResponse{ - Status: fmt.Sprintf("downloading %s", b.Digest), + Status: fmt.Sprintf("downloading %s", b.Digest[7:19]), Digest: b.Digest, Total: b.Total, Completed: b.Completed.Load(), @@ -322,7 +322,7 @@ func downloadBlob(ctx context.Context, opts downloadOpts) error { return err default: opts.fn(api.ProgressResponse{ - Status: fmt.Sprintf("downloading %s", opts.digest), + Status: fmt.Sprintf("downloading %s", opts.digest[7:19]), Digest: opts.digest, Total: fi.Size(), Completed: fi.Size(), diff --git a/server/upload.go b/server/upload.go index 306b6e63..19b0af91 100644 --- a/server/upload.go +++ b/server/upload.go @@ -301,7 +301,7 @@ func (b *blobUpload) Wait(ctx context.Context, fn func(api.ProgressResponse)) er } fn(api.ProgressResponse{ - Status: fmt.Sprintf("uploading %s", b.Digest), + Status: fmt.Sprintf("uploading %s", b.Digest[7:19]), Digest: b.Digest, Total: b.Total, Completed: b.Completed.Load(), @@ -352,7 +352,7 @@ func uploadBlob(ctx context.Context, mp ModelPath, layer *Layer, opts *RegistryO default: defer resp.Body.Close() fn(api.ProgressResponse{ - Status: fmt.Sprintf("uploading %s", layer.Digest), + Status: fmt.Sprintf("uploading %s", layer.Digest[7:19]), Digest: layer.Digest, Total: layer.Size, Completed: layer.Size,