mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
do not return error for usage-cache version v4 (#12276)
This commit is contained in:
parent
a592d3be19
commit
57aed841dd
@ -798,7 +798,7 @@ func (d *dataUsageCache) deserialize(r io.Reader) error {
|
||||
if n != 1 {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
ver := b[0]
|
||||
ver := int(b[0])
|
||||
switch ver {
|
||||
case dataUsageCacheVerV1:
|
||||
return errors.New("cache version deprecated (will autoupdate)")
|
||||
@ -900,6 +900,7 @@ func (d *dataUsageCache) deserialize(r io.Reader) error {
|
||||
|
||||
d.Cache[k] = e
|
||||
}
|
||||
return nil
|
||||
case dataUsageCacheVerCurrent:
|
||||
// Zstd compressed.
|
||||
dec, err := zstd.NewReader(r, zstd.WithDecoderConcurrency(2))
|
||||
@ -908,8 +909,9 @@ func (d *dataUsageCache) deserialize(r io.Reader) error {
|
||||
}
|
||||
defer dec.Close()
|
||||
return d.DecodeMsg(msgp.NewReader(dec))
|
||||
default:
|
||||
return fmt.Errorf("dataUsageCache: unknown version: %d", ver)
|
||||
}
|
||||
return fmt.Errorf("dataUsageCache: unknown version: %d", int(ver))
|
||||
}
|
||||
|
||||
// Trim this from start+end of hashes.
|
||||
|
Loading…
Reference in New Issue
Block a user