[#1302] writecache: Allow to specify custom page size
All checks were successful
DCO action / DCO (pull_request) Successful in 1m57s
Vulncheck / Vulncheck (pull_request) Successful in 2m6s
Tests and linters / Run gofumpt (pull_request) Successful in 2m9s
Build / Build Components (1.22) (pull_request) Successful in 2m37s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m49s
Tests and linters / Tests (1.21) (pull_request) Successful in 3m1s
Tests and linters / Tests (1.22) (pull_request) Successful in 3m4s
Tests and linters / Staticcheck (pull_request) Successful in 3m0s
Tests and linters / Tests with -race (pull_request) Successful in 3m9s
Tests and linters / Lint (pull_request) Successful in 3m30s
Tests and linters / gopls check (pull_request) Successful in 3m40s
Build / Build Components (1.21) (pull_request) Successful in 1m12s

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-08-08 13:32:18 +03:00
parent fa82854af4
commit 68029d756e
12 changed files with 35 additions and 4 deletions

View file

@ -48,6 +48,8 @@ type options struct {
metrics Metrics
// disableBackgroundFlush is for testing purposes only.
disableBackgroundFlush bool
// pageSize is bbolt's page size config value
pageSize int
}
// WithLogger sets logger.
@ -173,3 +175,10 @@ func WithDisableBackgroundFlush() Option {
o.disableBackgroundFlush = true
}
}
// WithPageSize sets bbolt's page size.
func WithPageSize(s int) Option {
return func(o *options) {
o.pageSize = s
}
}