mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Ensure cache has finished deserializing (#11620)
Make sure that response has been fully deserialized before returning.
This commit is contained in:
parent
b517c791e9
commit
03172b89e2
@ -186,14 +186,11 @@ func (client *storageRESTClient) CrawlAndGetDataUsage(ctx context.Context, cache
|
|||||||
var newCache dataUsageCache
|
var newCache dataUsageCache
|
||||||
pr, pw = io.Pipe()
|
pr, pw = io.Pipe()
|
||||||
go func() {
|
go func() {
|
||||||
pr.CloseWithError(newCache.deserialize(pr))
|
pw.CloseWithError(waitForHTTPStream(respBody, pw))
|
||||||
}()
|
}()
|
||||||
err = waitForHTTPStream(respBody, pw)
|
err = newCache.deserialize(pr)
|
||||||
pw.CloseWithError(err)
|
pr.CloseWithError(err)
|
||||||
if err != nil {
|
return newCache, err
|
||||||
return cache, err
|
|
||||||
}
|
|
||||||
return newCache, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *storageRESTClient) GetDiskID() (string, error) {
|
func (client *storageRESTClient) GetDiskID() (string, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user