[#726] writecache: Fix small object flush for BBolt

Do not marshal object twice.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-10-06 10:22:35 +03:00
parent bd5bf8b1a9
commit 997ac7cd8d
2 changed files with 9 additions and 9 deletions

View file

@ -29,7 +29,7 @@ type cache struct {
compressFlags map[string]struct{}
// flushCh is a channel with objects to flush.
flushCh chan *objectSDK.Object
flushCh chan objectInfo
// closeCh is close channel, protected by modeMtx.
closeCh chan struct{}
// wg is a wait group for flush workers.
@ -62,7 +62,7 @@ var (
// 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,
compressFlags: make(map[string]struct{}),