If NodeDisks are not empty do not impose cache maxSize restriction

master
Harshavardhana 10 years ago
parent efa91474e7
commit 8abb96c030
  1. 2
      pkg/donut/donut-v2.go

@ -304,6 +304,7 @@ func (donut API) CreateObject(bucket, key, expectedMD5Sum string, size int64, da
// createObject - PUT object to cache buffer
func (donut API) createObject(bucket, key, contentType, expectedMD5Sum string, size int64, data io.Reader) (ObjectMetadata, error) {
if len(donut.config.NodeDiskMap) == 0 {
if size > int64(donut.config.MaxSize) {
generic := GenericObjectError{Bucket: bucket, Object: key}
return ObjectMetadata{}, iodine.New(EntityTooLarge{
@ -312,6 +313,7 @@ func (donut API) createObject(bucket, key, contentType, expectedMD5Sum string, s
MaxSize: strconv.FormatUint(donut.config.MaxSize, 10),
}, nil)
}
}
if !IsValidBucket(bucket) {
return ObjectMetadata{}, iodine.New(BucketNameInvalid{Bucket: bucket}, nil)
}

Loading…
Cancel
Save