blockstore: change order of newARCCachedBS parmaeters

so the context is first one

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2016-09-06 08:03:05 +02:00
parent 66a031f17c
commit d1237f1c90
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ type arccache struct {
total metrics.Counter
}
func newARCCachedBS(bs Blockstore, ctx context.Context, lruSize int) (*arccache, error) {
func newARCCachedBS(ctx context.Context, bs Blockstore, lruSize int) (*arccache, error) {
arc, err := lru.NewARC(lruSize)
if err != nil {
return nil, err

View File

@ -140,7 +140,7 @@ func TestGetAndDeleteFalseShortCircuit(t *testing.T) {
}
func TestArcCreationFailure(t *testing.T) {
if arc, err := newARCCachedBS(nil, context.TODO(), -1); arc != nil || err == nil {
if arc, err := newARCCachedBS(context.TODO(), nil, -1); arc != nil || err == nil {
t.Fatal("expected error and no cache")
}
}

View File

@ -38,7 +38,7 @@ func CachedBlockstore(bs GCBlockstore,
ctx = metrics.CtxSubScope(ctx, "bs.cache")
if opts.HasARCCacheSize > 0 {
cbs, err = newARCCachedBS(cbs, ctx, opts.HasARCCacheSize)
cbs, err = newARCCachedBS(ctx, cbs, opts.HasARCCacheSize)
}
if opts.HasBloomFilterSize != 0 {
cbs, err = bloomCached(cbs, ctx, opts.HasBloomFilterSize, opts.HasBloomFilterHashes)