mirror of
https://github.com/minio/minio.git
synced 2024-12-27 15:45:55 -05:00
Merge pull request #566 from fkautz/pr_out_deleting_key_from_lastaccessedobjects_on_eviction
This commit is contained in:
commit
66e0fe23be
@ -498,6 +498,7 @@ func (memory *memoryDriver) doEvictObject(key lru.Key, value interface{}) {
|
|||||||
if len(storedBucket.objectMetadata) == 0 {
|
if len(storedBucket.objectMetadata) == 0 {
|
||||||
delete(memory.storedBuckets, bucket)
|
delete(memory.storedBuckets, bucket)
|
||||||
}
|
}
|
||||||
|
delete(memory.lastAccessedObjects, k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,5 +529,7 @@ func (memory *memoryDriver) expireLRUObjects() {
|
|||||||
func (memory *memoryDriver) updateAccessTime(key string) {
|
func (memory *memoryDriver) updateAccessTime(key string) {
|
||||||
memory.lock.Lock()
|
memory.lock.Lock()
|
||||||
defer memory.lock.Unlock()
|
defer memory.lock.Unlock()
|
||||||
|
if _, ok := memory.lastAccessedObjects[key]; ok {
|
||||||
memory.lastAccessedObjects[key] = time.Now().UTC()
|
memory.lastAccessedObjects[key] = time.Now().UTC()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user