[#826] blobovniczatree: Do not create DB's on init

Blobovniczas will be created on write requests.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-11-27 16:01:48 +03:00
parent ad0697adc4
commit db49ad16cc
9 changed files with 46 additions and 18 deletions

View file

@ -26,6 +26,7 @@ type cfg struct {
waitBeforeDropDB time.Duration
blzInitWorkerCount int
blzMoveBatchSize int
createDBInAdvance bool
}
type Option func(*cfg)
@ -139,3 +140,10 @@ func WithInitWorkerCount(v int) Option {
c.blzInitWorkerCount = v
}
}
// WithInitInAdvance returns an option to create blobovnicza tree DB's in advance.
func WithInitInAdvance(v bool) Option {
return func(c *cfg) {
c.createDBInAdvance = v
}
}