Skip to content

Commit 64acb22

Browse files
committed
Don't send progress while inflight
1 parent 574d828 commit 64acb22

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

internal/apk/soci.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ func (h *handler) tryNewIndex(w http.ResponseWriter, r *http.Request, prefix, re
118118
return kind, nil, nil, fmt.Errorf("renderPkgInfo(%q): %w", filename, err)
119119
}
120120
} else {
121-
blob.h = h
122-
blob.w = w
123-
blob.total = loadingBarSize(ref)
121+
if !inflight {
122+
blob.h = h
123+
blob.w = w
124+
blob.total = loadingBarSize(ref)
125+
}
124126

125127
httpserve.FileServer(fs).ServeHTTP(w, r)
126128
}

internal/explore/soci.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ func (h *handler) tryNewIndex(w http.ResponseWriter, r *http.Request, dig name.D
9494
// Render FS the old way while generating the index.
9595
fs := h.newLayerFS(tr, blob.size, ref, dig.String(), kind, types.MediaType(mt))
9696

97-
blob.h = h
98-
blob.w = w
99-
blob.total = loadingBarSize(dig.String())
97+
if !inflight {
98+
blob.h = h
99+
blob.w = w
100+
blob.total = loadingBarSize(dig.String())
101+
}
100102

101103
httpserve.FileServer(fs).ServeHTTP(w, r)
102104

0 commit comments

Comments
 (0)