mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-28 05:47:51 +08:00
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:
parent
66a031f17c
commit
d1237f1c90
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user