mirror of
https://github.com/minio/minio.git
synced 2025-01-27 06:33:18 -05:00
Fixing panic in intelligent, attempted to delete nonexistent key
This commit is contained in:
parent
a4b4e9c148
commit
ed71c28c37
@ -134,6 +134,7 @@ func (r *Intelligent) Set(key string, value interface{}) {
|
||||
|
||||
// Delete deletes a given key if exists
|
||||
func (r *Intelligent) Delete(key string) {
|
||||
if _, ok := r.items[key]; ok {
|
||||
r.currentSize -= uint64(len(r.items[key].([]byte)))
|
||||
delete(r.items, key)
|
||||
delete(r.updatedAt, key)
|
||||
@ -141,6 +142,7 @@ func (r *Intelligent) Delete(key string) {
|
||||
if r.OnEvicted != nil {
|
||||
r.OnEvicted(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Intelligent) isValid(key string) bool {
|
||||
|
Loading…
x
Reference in New Issue
Block a user