blockstore: change order of newARCCachedBS parmaeters

so the context is first one

License: MIT
Signed-off-by: 's avatarJakub Sztandera <kubuxu@protonmail.ch>
上级 66a031f1
......@@ -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
......
......@@ -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")
}
}
......
......@@ -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)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论