mirror of
https://github.com/minio/minio.git
synced 2025-11-11 06:20:14 -05:00
Fix max cache size calculation when system RAM is inferior to the default cache size (#3410)
This commit is contained in:
committed by
Harshavardhana
parent
5c9a95df32
commit
0cef971832
@@ -73,6 +73,9 @@ type Cache struct {
|
||||
// the items in the cache never expire (by default), and must be deleted
|
||||
// manually.
|
||||
func New(maxSize uint64, expiry time.Duration) *Cache {
|
||||
if maxSize == 0 {
|
||||
panic("objcache: setting maximum cache size to zero is forbidden.")
|
||||
}
|
||||
C := &Cache{
|
||||
maxSize: maxSize,
|
||||
entries: make(map[string]*buffer),
|
||||
|
||||
Reference in New Issue
Block a user