[#653] Add context parameter to Open functions

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
Ekaterina Lebedeva 2023-08-31 19:26:47 +03:00
parent a716db99db
commit 8a81af5a3b
43 changed files with 129 additions and 109 deletions

View file

@ -110,7 +110,7 @@ func newCache[Option any](
mb := meta.New(
meta.WithPath(filepath.Join(dir, "meta")),
meta.WithEpochState(dummyEpoch{}))
require.NoError(t, mb.Open(false))
require.NoError(t, mb.Open(context.Background(), false))
require.NoError(t, mb.Init())
bs := blobstor.New(blobstor.WithStorages([]blobstor.SubStorage{
@ -121,12 +121,12 @@ func newCache[Option any](
fstree.WithDirNameLen(1)),
},
}))
require.NoError(t, bs.Open(false))
require.NoError(t, bs.Open(context.Background(), false))
require.NoError(t, bs.Init())
wc := createCacheFn(t, smallSize, mb, bs, opts...)
t.Cleanup(func() { require.NoError(t, wc.Close()) })
require.NoError(t, wc.Open(false))
require.NoError(t, wc.Open(context.Background(), false))
require.NoError(t, wc.Init())
// First set mode for metabase and blobstor to prevent background flushes.