forked from TrueCloudLab/frostfs-node
[#726] writecache: Fix small object flush for Badger
Do not marshal object twice. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
997ac7cd8d
commit
d07afd803c
2 changed files with 12 additions and 9 deletions
|
@ -21,7 +21,7 @@ type cache struct {
|
|||
modeMtx sync.RWMutex
|
||||
|
||||
// flushCh is a channel with objects to flush.
|
||||
flushCh chan *objectSDK.Object
|
||||
flushCh chan objectInfo
|
||||
// scheduled4Flush contains objects scheduled for flush via flushCh
|
||||
// helps to avoid multiple flushing of one object
|
||||
scheduled4Flush map[oid.Address]struct{}
|
||||
|
@ -52,7 +52,7 @@ const (
|
|||
// New creates new writecache instance.
|
||||
func New(opts ...Option) writecache.Cache {
|
||||
c := &cache{
|
||||
flushCh: make(chan *objectSDK.Object),
|
||||
flushCh: make(chan objectInfo),
|
||||
mode: mode.ReadWrite,
|
||||
scheduled4Flush: map[oid.Address]struct{}{},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue