forked from TrueCloudLab/frostfs-node
[#220] shard: Enable write cache through option
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
47d2239332
commit
cbdcfb9159
1 changed files with 9 additions and 0 deletions
|
@ -22,6 +22,8 @@ type Shard struct {
|
||||||
type Option func(*cfg)
|
type Option func(*cfg)
|
||||||
|
|
||||||
type cfg struct {
|
type cfg struct {
|
||||||
|
useWriteCache bool
|
||||||
|
|
||||||
info Info
|
info Info
|
||||||
|
|
||||||
blobOpts []blobstor.Option
|
blobOpts []blobstor.Option
|
||||||
|
@ -78,3 +80,10 @@ func WithLogger(l *logger.Logger) Option {
|
||||||
c.log = l
|
c.log = l
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithWriteCache returns option to toggle write cache usage.
|
||||||
|
func WithWriteCache(use bool) Option {
|
||||||
|
return func(c *cfg) {
|
||||||
|
c.useWriteCache = use
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue