Merge pull request #2154 from dmcgowan/shared-content-ingests
content: shared content across namespaces
This commit is contained in:
@@ -19,7 +19,9 @@ package metadata
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"github.com/boltdb/bolt"
|
||||
@@ -45,6 +47,16 @@ func createContentStore(ctx context.Context, root string) (context.Context, cont
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
var (
|
||||
count uint64
|
||||
name = testsuite.Name(ctx)
|
||||
)
|
||||
wrap := func(ctx context.Context) (context.Context, func() error, error) {
|
||||
n := atomic.AddUint64(&count, 1)
|
||||
return namespaces.WithNamespace(ctx, fmt.Sprintf("%s-n%d", name, n)), func() error { return nil }, nil
|
||||
}
|
||||
ctx = testsuite.SetContextWrapper(ctx, wrap)
|
||||
|
||||
return ctx, NewDB(db, cs, nil).ContentStore(), func() error {
|
||||
return db.Close()
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user