[#77] Use writecache in local scenarios

Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
pull/79/head
Alejandro Lopez 2023-06-30 14:36:53 +03:00 committed by Evgenii Stratonikov
parent 8e99d08aa4
commit a1f5738d2f
1 changed files with 14 additions and 11 deletions

View File

@ -292,7 +292,9 @@ func storageEngineOptionsFromConfig(c *config.Config, debug bool) ([]engine.Opti
// write cache
if wc := sc.WriteCache(); wc.Enabled() {
opts = append(opts, shard.WithWriteCacheOptions(
opts = append(opts,
shard.WithWriteCache(true),
shard.WithWriteCacheOptions(
writecache.WithPath(wc.Path()),
writecache.WithMaxBatchSize(wc.BoltDB().MaxBatchSize()),
writecache.WithMaxBatchDelay(wc.BoltDB().MaxBatchDelay()),
@ -302,7 +304,8 @@ func storageEngineOptionsFromConfig(c *config.Config, debug bool) ([]engine.Opti
writecache.WithMaxCacheSize(wc.SizeLimit()),
writecache.WithNoSync(wc.NoSync()),
writecache.WithLogger(&logger.Logger{Logger: log}),
))
),
)
}
// tree