mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
crawler: Stream bucket usage cache data (#11068)
Stream bucket caches to storage and through RPC calls.
This commit is contained in:
@@ -171,14 +171,13 @@ func (s *storageRESTServer) CrawlAndGetDataUsageHandler(w http.ResponseWriter, r
|
||||
return
|
||||
}
|
||||
|
||||
done := keepHTTPResponseAlive(w)
|
||||
resp := streamHTTPResponse(w)
|
||||
usageInfo, err := s.storage.CrawlAndGetDataUsage(r.Context(), cache)
|
||||
done(err)
|
||||
if err != nil {
|
||||
resp.CloseWithError(err)
|
||||
return
|
||||
}
|
||||
w.Write(usageInfo.serialize())
|
||||
w.(http.Flusher).Flush()
|
||||
resp.CloseWithError(usageInfo.serializeTo(resp))
|
||||
}
|
||||
|
||||
// MakeVolHandler - make a volume.
|
||||
@@ -889,7 +888,6 @@ func waitForHTTPStream(respBody io.ReadCloser, w io.Writer) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
length := binary.LittleEndian.Uint32(tmp[:])
|
||||
_, err = io.CopyN(w, respBody, int64(length))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user