mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Fix issues with multipart upload
This commit is contained in:
2
pkg/donut/cache/data/data.go
vendored
2
pkg/donut/cache/data/data.go
vendored
@@ -85,8 +85,6 @@ func (r *Cache) SetMaxSize(maxSize uint64) {
|
||||
|
||||
// Stats get current cache statistics
|
||||
func (r *Cache) Stats() Stats {
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
return Stats{
|
||||
Bytes: r.currentSize,
|
||||
Items: r.items.Len(),
|
||||
|
||||
@@ -113,7 +113,12 @@ func New() (Interface, error) {
|
||||
return nil, iodine.New(err, nil)
|
||||
}
|
||||
for k, v := range buckets {
|
||||
a.storedBuckets.Set(k, v)
|
||||
var newBucket = storedBucket{}
|
||||
newBucket.objectMetadata = make(map[string]ObjectMetadata)
|
||||
newBucket.multiPartSession = make(map[string]MultiPartSession)
|
||||
newBucket.partMetadata = make(map[int]PartMetadata)
|
||||
newBucket.bucketMetadata = v
|
||||
a.storedBuckets.Set(k, newBucket)
|
||||
}
|
||||
}
|
||||
return a, nil
|
||||
|
||||
@@ -22,6 +22,8 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
. "github.com/minio/check"
|
||||
@@ -29,13 +31,20 @@ import (
|
||||
|
||||
func TestCache(t *testing.T) { TestingT(t) }
|
||||
|
||||
type MyCacheSuite struct{}
|
||||
type MyCacheSuite struct {
|
||||
root string
|
||||
}
|
||||
|
||||
var _ = Suite(&MyCacheSuite{})
|
||||
|
||||
var dc Interface
|
||||
|
||||
func (s *MyCacheSuite) SetUpSuite(c *C) {
|
||||
root, err := ioutil.TempDir(os.TempDir(), "donut-")
|
||||
c.Assert(err, IsNil)
|
||||
s.root = root
|
||||
|
||||
customConfigPath = filepath.Join(root, "donut.json")
|
||||
var err error
|
||||
dc, err = New()
|
||||
c.Assert(err, IsNil)
|
||||
@@ -46,6 +55,10 @@ func (s *MyCacheSuite) SetUpSuite(c *C) {
|
||||
c.Assert(len(buckets), Equals, 0)
|
||||
}
|
||||
|
||||
func (s *MyDonutSuite) TearDownSuite(c *C) {
|
||||
os.RemoveAll(s.root)
|
||||
}
|
||||
|
||||
// test make bucket without name
|
||||
func (s *MyCacheSuite) TestBucketWithoutNameFails(c *C) {
|
||||
// fail to create new bucket without a name
|
||||
|
||||
Reference in New Issue
Block a user