From cbdcfb915988f01bc55a647f6fe7169c56795008 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 30 Nov 2020 19:55:21 +0300 Subject: [PATCH] [#220] shard: Enable write cache through option Signed-off-by: Leonard Lyubich --- pkg/local_object_storage/shard/shard.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/local_object_storage/shard/shard.go b/pkg/local_object_storage/shard/shard.go index a8938f36e..f05b38ec0 100644 --- a/pkg/local_object_storage/shard/shard.go +++ b/pkg/local_object_storage/shard/shard.go @@ -22,6 +22,8 @@ type Shard struct { type Option func(*cfg) type cfg struct { + useWriteCache bool + info Info blobOpts []blobstor.Option @@ -78,3 +80,10 @@ func WithLogger(l *logger.Logger) Option { c.log = l } } + +// WithWriteCache returns option to toggle write cache usage. +func WithWriteCache(use bool) Option { + return func(c *cfg) { + c.useWriteCache = use + } +}