mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
Don't replace caches that are receiving updates (#10834)
Keep caches while they are receiving updates. Move update code to separate function.
This commit is contained in:
@@ -372,24 +372,7 @@ func (b *bucketMetacache) updateCacheEntry(update metacache) (metacache, error)
|
||||
logger.Info("updateCacheEntry: bucket %s list id %v not found", b.bucket, update.id)
|
||||
return update, errFileNotFound
|
||||
}
|
||||
|
||||
existing.lastUpdate = UTCNow()
|
||||
|
||||
if existing.status == scanStateStarted && update.status == scanStateSuccess {
|
||||
existing.ended = UTCNow()
|
||||
existing.endedCycle = update.endedCycle
|
||||
}
|
||||
|
||||
if existing.status == scanStateStarted && update.status != scanStateStarted {
|
||||
existing.status = update.status
|
||||
}
|
||||
|
||||
if existing.error == "" && update.error != "" {
|
||||
existing.error = update.error
|
||||
existing.status = scanStateError
|
||||
existing.ended = UTCNow()
|
||||
}
|
||||
existing.fileNotFound = existing.fileNotFound || update.fileNotFound
|
||||
existing.update(update)
|
||||
b.caches[update.id] = existing
|
||||
b.updated = true
|
||||
return existing, nil
|
||||
|
||||
Reference in New Issue
Block a user