mirror of
https://github.com/minio/minio.git
synced 2024-12-23 21:55:53 -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
|
||||
pr, pw = io.Pipe()
|
||||
go func() {
|
||||
pr.CloseWithError(newCache.deserialize(pr))
|
||||
pw.CloseWithError(waitForHTTPStream(respBody, pw))
|
||||
}()
|
||||
err = waitForHTTPStream(respBody, pw)
|
||||
pw.CloseWithError(err)
|
||||
if err != nil {
|
||||
return cache, err
|
||||
}
|
||||
return newCache, nil
|
||||
err = newCache.deserialize(pr)
|
||||
pr.CloseWithError(err)
|
||||
return newCache, err
|
||||
}
|
||||
|
||||
func (client *storageRESTClient) GetDiskID() (string, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user