mirror of
https://github.com/minio/minio.git
synced 2024-12-26 23:25:54 -05:00
Making lock much less aggressive, fixes multiple uploads blocking
This commit is contained in:
parent
d11803b125
commit
a974e4d7c7
@ -197,7 +197,6 @@ func (memory *memoryDriver) CreateObject(bucket, key, contentType, expectedMD5Su
|
|||||||
|
|
||||||
contentType = strings.TrimSpace(contentType)
|
contentType = strings.TrimSpace(contentType)
|
||||||
|
|
||||||
memory.lock.Lock()
|
|
||||||
if strings.TrimSpace(expectedMD5Sum) != "" {
|
if strings.TrimSpace(expectedMD5Sum) != "" {
|
||||||
expectedMD5SumBytes, err := base64.StdEncoding.DecodeString(strings.TrimSpace(expectedMD5Sum))
|
expectedMD5SumBytes, err := base64.StdEncoding.DecodeString(strings.TrimSpace(expectedMD5Sum))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -246,6 +245,7 @@ func (memory *memoryDriver) CreateObject(bucket, key, contentType, expectedMD5Su
|
|||||||
Md5: md5Sum,
|
Md5: md5Sum,
|
||||||
Size: int64(totalLength),
|
Size: int64(totalLength),
|
||||||
}
|
}
|
||||||
|
memory.lock.Lock()
|
||||||
if _, ok := memory.objectMetadata[objectKey]; ok == true {
|
if _, ok := memory.objectMetadata[objectKey]; ok == true {
|
||||||
memory.lock.Unlock()
|
memory.lock.Unlock()
|
||||||
return iodine.New(drivers.ObjectExists{Bucket: bucket, Object: key}, nil)
|
return iodine.New(drivers.ObjectExists{Bucket: bucket, Object: key}, nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user