Merge pull request #504 from fkautz/pr_out_making_lock_much_less_aggressive_fixes_multiple_uploads_blocking

master
Frederick F. Kautz IV 10 years ago
commit 8a57006b36
  1. 2
      pkg/storage/drivers/memory/memory.go

@ -197,7 +197,6 @@ func (memory *memoryDriver) CreateObject(bucket, key, contentType, expectedMD5Su
contentType = strings.TrimSpace(contentType)
memory.lock.Lock()
if strings.TrimSpace(expectedMD5Sum) != "" {
expectedMD5SumBytes, err := base64.StdEncoding.DecodeString(strings.TrimSpace(expectedMD5Sum))
if err != nil {
@ -246,6 +245,7 @@ func (memory *memoryDriver) CreateObject(bucket, key, contentType, expectedMD5Su
Md5: md5Sum,
Size: int64(totalLength),
}
memory.lock.Lock()
if _, ok := memory.objectMetadata[objectKey]; ok == true {
memory.lock.Unlock()
return iodine.New(drivers.ObjectExists{Bucket: bucket, Object: key}, nil)

Loading…
Cancel
Save