From 6f44858287f99251fec52d910780838ced064ab3 Mon Sep 17 00:00:00 2001 From: Alejandro Lopez Date: Fri, 30 Jun 2023 14:36:53 +0300 Subject: [PATCH] [#77] Use writecache in local scenarios Signed-off-by: Alejandro Lopez --- internal/local/local.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/internal/local/local.go b/internal/local/local.go index 3b6a654..0f04317 100644 --- a/internal/local/local.go +++ b/internal/local/local.go @@ -292,17 +292,20 @@ func storageEngineOptionsFromConfig(c *config.Config, debug bool) ([]engine.Opti // write cache if wc := sc.WriteCache(); wc.Enabled() { - opts = append(opts, shard.WithWriteCacheOptions( - writecache.WithPath(wc.Path()), - writecache.WithMaxBatchSize(wc.BoltDB().MaxBatchSize()), - writecache.WithMaxBatchDelay(wc.BoltDB().MaxBatchDelay()), - writecache.WithMaxObjectSize(wc.MaxObjectSize()), - writecache.WithSmallObjectSize(wc.SmallObjectSize()), - writecache.WithFlushWorkersCount(wc.WorkersNumber()), - writecache.WithMaxCacheSize(wc.SizeLimit()), - writecache.WithNoSync(wc.NoSync()), - writecache.WithLogger(&logger.Logger{Logger: log}), - )) + opts = append(opts, + shard.WithWriteCache(true), + shard.WithWriteCacheOptions( + writecache.WithPath(wc.Path()), + writecache.WithMaxBatchSize(wc.BoltDB().MaxBatchSize()), + writecache.WithMaxBatchDelay(wc.BoltDB().MaxBatchDelay()), + writecache.WithMaxObjectSize(wc.MaxObjectSize()), + writecache.WithSmallObjectSize(wc.SmallObjectSize()), + writecache.WithFlushWorkersCount(wc.WorkersNumber()), + writecache.WithMaxCacheSize(wc.SizeLimit()), + writecache.WithNoSync(wc.NoSync()), + writecache.WithLogger(&logger.Logger{Logger: log}), + ), + ) } // tree