Fix odd shadowing bug in XL init. (#3874)

Fixes #3873
This commit is contained in:
Harshavardhana 2017-03-08 20:42:45 -08:00 committed by GitHub
parent 8a9852220d
commit 43317530d5
2 changed files with 5 additions and 7 deletions

View File

@ -71,10 +71,8 @@ verifiers: vet fmt lint cyclo spelling
vet:
@echo "Running $@:"
@go tool vet -all ./cmd
@go tool vet -all ./pkg
@go tool vet -shadow=true ./cmd
@go tool vet -shadow=true ./pkg
@go vet github.com/minio/minio/cmd/...
@go vet github.com/minio/minio/pkg/...
fmt:
@echo "Running $@:"

View File

@ -140,9 +140,9 @@ func newXLObjects(storageDisks []StorageAPI) (ObjectLayer, error) {
// Check if object cache is enabled.
if xl.objCacheEnabled {
// Initialize object cache.
objCache, err := objcache.New(maxCacheSize, objcache.DefaultExpiry)
if err != nil {
return nil, err
objCache, oerr := objcache.New(maxCacheSize, objcache.DefaultExpiry)
if oerr != nil {
return nil, oerr
}
objCache.OnEviction = func(key string) {
debug.FreeOSMemory()